It was recommended by javaAdict, honestly I did not understand what it meant, but it did not work.
what i was trying to do is to read a line of integers separated by white space that is entered by the user and and store then into an array of integer as soon as the user hit enter.