Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Instance Initializer

 
Shiaber Shaam
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When a class gets loaded? What happens when the constructor is called? When is static block gets called? What is an instance initializer block?
 
David Byron
Rancher
Posts: 175
Clojure Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here....
 
Janeice DelVecchio
Saloon Keeper
Posts: 1808
12
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Understanding the order of operation for how a class gets loaded is really important.

Always remember Static blocks and members load before any instance members get loaded. Anything static gets loaded top to bottom.
Constructors always make a call to super() before doing their thing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic