,當我想在我的項目Eclipse導入掃描器類告訴我一些errore:無法使用掃描儀類的構造函數是不確定的,方法是未定義
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());
}
}
還是有錯誤? – gjman2