【发布时间】:2015-03-25 16:29:55
【问题描述】:
我遇到了一个问题,因为当我尝试编译我的代码时,它说找不到该扫描仪作为符号。
我能做些什么来解决它?
public class Unit10
{
public static void main( String[] args )
{
scanner input = new scanner(System.in);
int numEmployees;
System.out.println( "How many employees do you wish to enter?" );
numEmployees = input.nextInt();
Employee[] employeeArray = new Employee[numEmployees];
for ( int i = 0; i < numEmployees; i++ )
{
Employee e1 = new Employee();
Name first = new Name();
Name last = new Name();
System.out.println( "Enter the first name of the employee" );
e1.setFirstName( input.nextLine() );
System.out.println( "Enter the last name of the employee" );
e1.setLastName( input.nextLine() );
}
}
}
【问题讨论】:
标签: java int java.util.scanner