jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes class loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class loading" Watch "class loading" New topic

class loading

Bob Gucco

Joined: Jan 18, 2001
Posts: 16
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

Joined: Jan 09, 2001
Posts: 1492
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 ...
Bob Gucco

Joined: Jan 18, 2001
Posts: 16
Thank you
I agree. Here's the link: http://aspose.com/file-tools
subject: class loading
It's not a secret anymore!