4 ms·
> I spent about 15 minutes, failed, then searched Google for an example. It is understandable that Java can be verbose, but 15 minutes followed by failure, ma
by samirahmed 15y ago
> I spent about 15 minutes, failed, then searched Google for an example.
It is understandable that Java can be verbose, but 15 minutes followed by failure, make the author seem almost clueless about Java.
- georgieporgie 15y agoThe author explained that: I'm actually kind of embarassed I had so much trouble with this - I've been working on a commercial Java package for two years, but because it's GUI based I rarely have to deal with reading from the console. Real Java programmers will probably look down on me with a mixture of pity and disgust. Such is life.
- Wilya 15y agoI'm not sure I could write that code right without Eclipse, or at least not without quite a few runs through the compiler and looks to the docs.. I'm not a Java guru, but I have used it quite a lot. It's not hard in itself, but it is overly long, with a lot of things to remember.
- deleted 15y ago[deleted]
- nierman 15y agoyeah, 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.
- cgag 15y agoI think it's fairly reasonable to not remember how to deal with user input in java when you need to remember what combination of streams and readers and buffers and scanners you need to put together to do it.