Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

class loading

 
Bob Gucco
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would you explain me please a process of loading classes,
sequence of initialization of static variables, static blocks,
public static void main(String[] args)...
How is it beiing determined what to initialize first - by import statements, class calling statements ...?
Would you give me some example on that please?
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I can't explain the processes of loading classes because it is perform by the JVM when the class is required.
As far as initialization is concerned it works in the following order:
1. Static initializers
2. Instance initializers
3. Constructors
Within each part the order (top to bottom) determines initialization.
Can't think of any examples that would show you that though ...
Manfred.
 
Bob Gucco
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic