import java.util.*;
class ScannerTest {
public static void main(
String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter your Roll No.");
int rno = in.nextInt();
System.out.print("\nEnter your Full Name:");
String name =in.nextLine();
System.out.print("Enter percentage:");
double per = in.nextDouble();
System.out.println("\n\n\nHere is the info : ");
System.out.println("\nName:"+name+"\nRoll No."+rno+"\nPercentage : "+per);
}
}
In this code, when i execute it. The line(in bolds) which asked to enter NAme is skipped. Can anyone tell me why this is happening ? Thanks