Sequence

class Pupil{
Pupil(int age){
System.out.println("pupil:"+age);
}
}
class Teacher{
Pupil p1=new Pupil(9);
Teacher(){
System.out.println("Teacher()");
p3=new Pupil(10);
}
Pupil p2=new Pupil(11);
void teach(){
System.out.println("teach()");
}
Pupil p3=new Pupil(12);
}
public class Sequence {

public static void main(String[] args) {
// TODO 自动生成的方法存根
Teacher t=new Teacher();
t.teach();

}

}

posted @ 2017-03-16 17:39  大仁哥汪宝  阅读(216)  评论(0编辑  收藏  举报