为什么我这里Scanner类不能用啊?
import java.util.*;
public class Ppt
{
public static void main(String arg[])
{
Scanner sc = new Scanner(System.in);
int i = sc.nextInt();
}
}
为什么,我编译时会不行?
错误:
Ppt.java:6: cannot resolve symbol
symbol : class Scanner
location: class Ppt
Scanner sc = new Scanner(System.in);
^
Ppt.java:6: cannot resolve symbol
symbol : class Scanner
location: class Ppt
Scanner sc = new Scanner(System.in);
^
----------------解决方案--------------------------------------------------------
你的JDK太老了
要JDK1.5以上的才能用
----------------解决方案--------------------------------------------------------