members of a class
1. properties(static and instance)
2. methods (static and instance)
4. blocks. (static and instance)
//first variable and property.
1. static properties are initialized.
2. static blocks are executed.
3. static methods are executed only when we call them.
we can use static methods to initialize properties. And we call static methods within the static block.
Note:: static methods are called before blocks if we use them to initialize the properties.
4. instance properties are initialized.
5. instance blocks are executed.
6. constructors are executed.
7. instance methods are executed only when we call by using instance.
Note:: instance methods are called before constructor and before
blocks if we use them to initialize instance properties.
we can not call instance members in static members why because by the time we are executing static members there is no guaranty of object
availability. The reverse is possible.