Two Laptop Bag*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "class loading" Watch "class loading" New topic
Author

class loading

Bob Gucco
Greenhorn

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
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

Joined: Jan 18, 2001
Posts: 16
Thank you
 
 
subject: class loading
 
Similar Threads
use of Class.forName()?
about class.forName
import java.sql
Regarding JDBC....
static initializations