Hacker News new | ask | show | jobs
by nierman 5209 days 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);
        }
    }
1 comments

Very 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.