1.When a class is used for first time, it needs to be loaded . Loadind involves two phases :
1.1. Load superclass Before loading any class , its superclass must be loaded if it is not already loaded.This is a recursive process until a superclass along the inheritace chain is already loaded.
1.2. After a class is loaded to the memory,its static data fields and static initialization block are executed in the order they appear in the class.
2.Invoking a constructor of the class involves three phases:
2.1 Invoke a constructor of the superclass.This is a recursive process until the superclass is java.lang.Object.
2.2 Initialize instance data fields and execute initialization blocks in the order they appear in the class.
2.3 Execute the body of the constructor.
物件/ inherent/ Concepts of Object Orientation/Abstraction
Specialization/Encapsulation/Inheritance/Polymorphism
請先 登入 以發表留言。