当我想在我的项目中导入扫描仪类时,eclipse 向我展示了一些错误:
Exception in thread "main" java.lang.Error: Unresolved compilation problems: The constructor Scanner(InputStream) is undefined The method nextLine() is undefined for the type Scanner
这是我的代码:
import java.util.Scanner;
public class Scanner {
public static void main(String[] args) {
Scanner myScanner = new Scanner(System.in);
System.out.println(myScanner.nextLine());
}
}