public class staticInter
{
public static class Student
{
int no;
String name;
int age;
static int count=0;
Student(int no,String name,int age)
{
this.no=no;
this.name=name;
this.age=age;
count++;
}
public void show()
{
System.out.println("xuhao: "+count+"\t"+no+"\t"+name+"\t"+age);
}
}
public static void main(String[] args)
{
staticInter.Student s1=new staticInter.Student(2009123,"zhangsan",20);
s1.show();
staticInter.Student s2=new staticInter.Student(2009145,"lisi",18);
s2.show();
}
}
staticInter
最新推荐文章于 2021-02-25 19:53:50 发布