public class ly{
public class home{
int name = 605;
int num=5;
public void zhu(){
System.out.println("寝室可以住");
System.out.println("寝室名"+name+"寝室人数"+num);
}
}
public static void main(String[] args){
int num=6;
home qin = new home();
qin.zhu();
}
}
需要将 public class home{改为 public static class home{才可以运行 但是人数显示5而非6
相关分类