Java End-of-file

  • + 7 comments

    that's made wrong this is the right :

    Scanner sc = new Scanner(System.in);

            while (sc.hasNextLine()) {
                int x=1;
                System.out.println(x++ + " " +sc.nextLine());
    
    
            }