classPerson {String name= "Li Guang";//name PublicPerson () {//super ();//write without writing the statement, the same effectSystem.out.println ("Execute person ()"); } PublicPerson (String name) { This. Name =name; System.out.println ("Execute person (name)"); }}classStudentextendsPerson {String School= "Wuhan University";//School PublicStudent () {//super ();//write without writing the statement, the same effectSystem.out.println ("Execute Student ()"); } PublicStudent (string name, string school) {Super(name);//The display called the parent class has a parameter constructor method, and no parameter construction method is executed This. School =School; System.out.println ("Execute Student (name,school)"); }}classPostgraduateextendsStudent {String guide;//Mentor PublicPostgraduate () {//super ();//write without writing the statement, the same effectSystem.out.println ("Execute postgraduate ()"); } PublicPostgraduate (string name, String school, string guide) {Super(name, school); This. Guide =Guide ; System.out.println ("Execute postgraduate (name, School, guide)"); }}classTestinherit { Public Static voidMain (string[] args) {Postgraduate Pgdt=NULL; PGDT=NewPostgraduate (); System.out.println (); PGDT=NewPostgraduate ("Liu Jiao", "Peking University", "Miss Wang"); }}
11. Breakpoint Tracing Initialization Process