staticInter

来源:互联网 发布:淘宝苏宁易购退笔记本 编辑:程序博客网 时间:2024/06/07 22:32
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();}}

原创粉丝点击