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

創作者介紹
創作者 Sun's 異次元世界 的頭像
fennitw

Sun's 異次元世界

fennitw 發表在 痞客邦 留言(0) 人氣( 187 )