java中初始化时机和顺序呢
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){ Teacher t=new Teacher(); t.teach(); } }
心有所想,手便有所作,协同起每一分神经的触动,让畅想看到骄傲的成果,辉煌一散笔下,回首一幕天空,让世人的见长铸就我翱翔的梦