Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused about this output-Constructor doubt

 
Amit Batra
Ranch Hand
Posts: 361
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

how come after the implicit call to super() in X's constructor it busts out of the constructor to create Y() first before finishing up its own work?
 
bing marquez
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
check this out.
 
wise owen
Ranch Hand
Posts: 2023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Initialization:

In Java , when an object is created, initialization is done in this order:
  • Set fields to default initial values (0, false, null)
  • Call the constructor for the object (but don't execute the body of the constructor yet)
  • Invoke the constructor of the superclass
  • Initialize fields using initializers and initialization blocks
  • Execute the body of the constructor

  •  
    Amit Batra
    Ranch Hand
    Posts: 361
    • 0
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thanks guys.
     
    I agree. Here's the link: http://aspose.com/file-tools
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic