Main.java click
StringCalculator.java click
public class Main {
public static void main(String[] args) {
//Instantiating the StringCalculator class
StringCalculator sc = new StringCalculator();
//Calling add method by passing string as argument
System.out.println(sc.add("");
}
}
0
public class Main {
public static void main(String[] args) {
//Instantiating the StringCalculator class
StringCalculator sc = new StringCalculator();
//Calling add method by passing string as argument
System.out.println(sc.add("1"));
}
}
1
public class Main {
public static void main(String[] args) {
//Instantiating the StringCalculator class
StringCalculator sc = new StringCalculator();
//Calling add method by passing string as argument
System.out.println(sc.add("1,2,3,4"));
}
}
10
public class Main {
public static void main(String[] args) {
//Instantiating the StringCalculator class
StringCalculator sc = new StringCalculator();
//Calling add method by passing string as argument
System.out.println(sc.add("a,b,c,d"));
}
}
10
public class Main {
public static void main(String[] args) {
//Instantiating the StringCalculator class
StringCalculator sc = new StringCalculator();
//Calling add method by passing string as argument
System.out.println(sc.add("1,2,3,4,a,b,c,d"));
}
}
20
public class Main {
public static void main(String[] args) {
//Instantiating the StringCalculator class
StringCalculator sc = new StringCalculator();
//Calling add method by passing string as argument
System.out.println(sc.add("1,2,3\n4,5,6\nA\nb"));
}
}
24
public class Main {
public static void main(String[] args) {
//Instantiating the StringCalculator class
StringCalculator sc = new StringCalculator();
//Calling add method by passing string as argument
System.out.println(sc.add("//:\n1:2:3:4:5:a:b"));
}
}
18
public class Main {
public static void main(String[] args) {
//Instantiating the StringCalculator class
StringCalculator sc = new StringCalculator();
//Calling add method by passing string as argument
System.out.println(sc.add("1,2,3,1001,1000,1,2");
}
}
1009