import java.util.*;public class InputText
{
public static void main(String[] args)
{
   Scanner in = new Scanner(System.in); //get first input
System.out.print("what is your name");
String name = in.nextLine(); //get second input
System.out.print("How old are you?");
int age = in.nextInt(); //display output on console
System.out.println("Hello, " + name + ".Next year, you'll be " + (age + 1));
}
}
上面是我按照java2核心技术基础知识例3-2输入的程序,可计算机说scanner 是不能解决的符号(cannot ressolve symbol)
请高手指教啊