6 ms·
yeah, the use of java.util.Scanner would make it much more succinct: import java.util.Scanner; public class Addup { public static void mai
by nierman 15y ago
yeah, the use of java.util.Scanner would make it much more succinct:
import java.util.Scanner;
public class Addup {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int i1 = sc.nextInt();
int i2 = sc.nextInt();
System.out.println(i1 + i2);
}
}
- techtalsky 15y agoVery interesting, although he does indeed say: > The extensive class library is however quite daunting. It appears there's a class for almost everything, and much of "programming in Java" seems to consist of "searching for the right class". Even after two years I find I cannot do much in Java without constant reference to the documentation.