Error: Exception in thread "main" java.util.NoSuchElementException: No line found
at java.util.Scanner.nextLine(Scanner.java:1540)
at Main.main(Main.java:13)
代码:
import java.util.Scanner;
public class Main
{
public static void main (String[] args)
{
Scanner in;
in = new Scanner(System.in);
String name;
System.out.print("Enter your name: ");
name = in.nextLine();
System.out.print(name);
}
}