这是什么情况?为什么说找不到符号?39行setID
import *;class Employees
{
private static int id;
public String name;
public Employees(String n,int i)
{
this.name=n;
this.id=i;
}
public static void setId()
{
id++;
}
public int getId()
{
return this.id;
}
public String getName()
{
return this.name;
}
}
public class text4
{
public static void main(String[] args)
{
Employees[] a=new Employees[3];
a[0]=new Employees("张三",1000);
a[1]=new Employees("李四",2000);
a[2]=new Employees("王五",1800);
for(int i=0;i<a.length;i++)
{
setId();
System.out.println("名字="+a[i].getName()+" ID="+a[i].getId());
}
}
}