Re: acces of members of subclass
- From: Lew <lew@xxxxxxxxxxxxx>
- Date: Mon, 28 Jul 2008 11:28:07 -0700 (PDT)
On Jul 28, 1:37 pm, Mark Space <marksp...@xxxxxxxxxxxxxx> wrote:
Lew wrote:
Daniel Moyne wrote:
- Sub may have itw own typical constructor with its own parameters
where of
course super(...) is not present.
'super()' is always present, if only implicitly. If you do not provide
one, the compiler inserts a call to the no-argument 'super()' for you.
Er, lots of classes have no zero-argument constructor, so Daniel is
correct. Any given sub-class, in the general case, cannot rely on the
presence of a super() call.
From the JLS:
If a constructor body does not begin with an explicit constructor invocation and the
constructor being declared is not part of the primordial class Object, then the
constructor body is implicitly assumed by the compiler to begin with a superclass
constructor invocation "super();", an invocation of the constructor of its direct
superclass that takes no arguments.
The call to super() is *always* present. Any given class, in the
general case, can rely on the presence of super() call. Daniel and
you are not correct.
--
Lew
.
- Follow-Ups:
- Re: acces of members of subclass
- From: Mark Space
- Re: acces of members of subclass
- From: Eric Sosman
- Re: acces of members of subclass
- References:
- [General]acces of members of subclass
- From: Daniel Moyne
- Re: [General]acces of members of subclass
- From: RedGrittyBrick
- Re: [General]acces of members of subclass
- From: Lew
- Re: [General]acces of members of subclass
- From: Daniel Moyne
- Re: [General]acces of members of subclass
- From: Lew
- Re: [General]acces of members of subclass
- From: Daniel Moyne
- Re: [General]acces of members of subclass
- From: Lew
- Re: [General]acces of members of subclass
- From: Mark Space
- [General]acces of members of subclass
- Prev by Date: Re: Trash appears in JSP page upon declaring error page
- Next by Date: Scrolling JList to Bottom
- Previous by thread: Re: [General]acces of members of subclass
- Next by thread: Re: acces of members of subclass
- Index(es):
Relevant Pages
|