Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

initialization sequence

 
geeta rai
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could someone pls enlighten on the sequence of initialization steps when we have initializer blocks(both static and instance), superclass and subclass constructors in consideration.
Thanks.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope the following link might help you, which I bookmarked long time ago, when I was on my way to SCJP 1.2....
http://www.artima.com/objectsandjava/webuscript/InitCleanup1.html
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
geeta,
When I'm curious about things of this nature, I like to write myself a quick example program to see just what happens.
Concerning your curiousity, the following example
Foo

MiniBar

Bar

produces the following output.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic