Instance creation (at the time of new) ① Field initialization ② Call the constructor
Aaa o = new Bbb(100); When creating such an instance, jump to the constructor of Bbb class
System.out.println(o.a); In case of field, jump to the field of Aaa class which is type
o.sample() When the method is called, it jumps to the method of Bbb which is an object.
Recommended Posts