Results 1 to 4 of 4
  1. #1
    ezee is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default What, if we call super() from parents default constructor?

    Thanks for doing analysis.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,570
    Blog Entries
    7
    Rep Power
    21

    Default Re: What, if we call super() from parents default constructor?

    Are you expecting something spectacular to happen? A default constructor (better: no-arg constructor) is just a constructor and every constructor either calls another constructor in its class or it calls a superclass constructor.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    ezee is offline Member
    Join Date
    Mar 2009
    Posts
    14
    Rep Power
    0

    Default Re: What, if we call super() from parents default constructor?

    It is the parent class constructor which is not deriving from any other class. So will it call object class constructor?

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,570
    Blog Entries
    7
    Rep Power
    21

    Default Re: What, if we call super() from parents default constructor?

    Quote Originally Posted by ezee View Post
    It is the parent class constructor which is not deriving from any other class. So will it call object class constructor?
    Every class extends from another class; either explicitly or implicitly from the Object class; so the answer to your question is yes.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 7
    Last Post: 10-28-2011, 07:26 AM
  2. Default constructor by compiler.
    By manishdivs in forum New To Java
    Replies: 2
    Last Post: 09-19-2011, 05:31 PM
  3. Replies: 3
    Last Post: 01-21-2011, 01:37 PM
  4. how to call higher level super class method?
    By satheeshtech in forum Advanced Java
    Replies: 2
    Last Post: 01-12-2010, 03:11 PM
  5. Private constructor and super()
    By Basit56 in forum Advanced Java
    Replies: 9
    Last Post: 08-21-2009, 06:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •