请问程序哪里出错了?
public class Lili {int id;
String name;
public Lili(int id,String name){
this.id=id;
this.name=name;
}
static List<Lili> list=new ArrayList<Lili>();
Lili l_1=new Lili(0,"name1");
Lili l_2=new Lili(1,"name2");
{
list.add(l_1);
list.add(l_2);
}
public static Lili getSkillById(int id){
for(Lili h:list){
if(h.id==id)
return h;}
return null;
}
public static void main(String[] args){
Lili skill=getSkillById(0);
int i=skill.id;
System.out.print(i);
}
}