Java End-of-file

  • + 7 comments

    Even shorter:

    for(int i=1; scan.hasNext() ; System.out.println(i++ +" "+scan.nextLine()));