This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Confused about this output-Constructor doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Confused about this output-Constructor doubt" Watch "Confused about this output-Constructor doubt" New topic
Author

Confused about this output-Constructor doubt

Amit Batra
Ranch Hand

Joined: Mar 04, 2006
Posts: 361

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

Joined: Aug 06, 2006
Posts: 11
check this out.
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
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

    Joined: Mar 04, 2006
    Posts: 361
    Thanks guys.
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Confused about this output-Constructor doubt
     
    Similar Threads
    Help with Understanding the Output
    get confusion in constructor execution
    Consturctor Invocation,
    Class instantiation process
    constructor