Java End-of-file

  • + 0 comments
        Scanner x= new Scanner(System.in);
        int i = 1;
        while(x.hasNext()){
            System.out.printf("%d %s%n", i++, x.nextLine());
        }
                x.close();
                don't forget close scanner