4

reading a stream of numbers from standard input in java

view full story
linux-howto

http://ubuntuforums.org – guys, I'm trying to read a stream of numbers from standard input like: 2 3 -3 10 44 9 -1. The line ends once it read -1, but for some reason I have an endless loop... how could I read this stream of numbers one number at a time? Code: int num[] = new int[5];         char ch;           BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));         System.out.println("enter series of number: ");                int i = 0;         (Hardware)