I have this code.

String anun=sc.nextLine(); System.out.println("age:"); int tar=sc.nextInt(); System.out.println("email:"); String mail=sc.nextLine(); System.out.println(mail); System.out.println("email:" + mail); 

And always, when it's time for String mail=sc.nextLine(); just skip step. What is the problem?

    1 answer 1

    In this line, you counted only a number (not taking into account everything that can go further, including the end of the line):

     sc.nextInt(); 

    Further, when you call

     sc.nextLine(); 

    The end of the line is read (starting from the previously entered number and ending with the line break). You can add an extra call to sc.nextLine(); after each call to nextInt(); .