You are viewing a single comment's thread. Return to all comments →
for(int i=1; scan.hasNext() ; System.out.println(i++ +" "+scan.nextLine()));
That's pretty sweet! Thanks.
That's not very readable code! A while loop is more appropriate.
Thanks for a different a view.
Oh...thats great idea =))
what scan.hasNext do?
it checks,is the scanner has more tokens in its input