• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

order of execution in java

 
Hung Chang
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 158
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic