Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes order of execution in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "order of execution in java" Watch "order of execution in java" New topic
Author

order of execution in java

Hung Chang
Greenhorn

Joined: Oct 21, 2001
Posts: 16
hi guys.
what is the order of execution in java.
IS IT
static variables/blocks, contructor, instance variables/blocks.
OR
static variables/blocks, instance variables/blocks,contructor.
Michael Bruesch
Ranch Hand

Joined: Sep 23, 2001
Posts: 158
When the class is loaded, the static variables/blocks are initialized first. Then when the class is instantiated, the instance variables/blocks are initialized and then the constructor is executed.


Michael J Bruesch<br /><i>I code, therefore I am.</i>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: order of execution in java