You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
536 B

7 years ago
7 years ago
7 years ago
  1. public class TestParseString
  2. {
  3. public static void main(String[] args)
  4. {
  5. String s1 = "12.3,4.9 6,9 0,8";
  6. ParseString ps1 = new ParseString(s1);
  7. System.out.println("Sum of all number in \"" + s1 + "\" is: ");
  8. System.out.println(ps1.sumOfAll());
  9. System.out.println();
  10. String s2 = "120,8 7.3,6.4 0.1,8.0";
  11. ParseString ps2 = new ParseString(s2);
  12. System.out.println("Sum of all number in \"" + s2 + "\" is: ");
  13. System.out.println(ps2.sumOfAll());
  14. System.out.println();
  15. }
  16. }