| Author |
Constructor
|
rex tony
Ranch Hand
Joined: Aug 29, 2007
Posts: 159
|
|
Good afternoon to all. the answer is subclass! subclass! How? explain [Jesper Young: Corrected code tags and indentation] [ October 01, 2007: Message edited by: Jesper Young ]
|
 |
Sheikh Sadiruddin
Greenhorn
Joined: Aug 10, 2007
Posts: 21
|
|
Hi rex tony, You are overriding superclass,s method() in subclass. so in runtime the subclass version of the method() runs.Hence the out put follows.
|
SCJP 6 (80%) || SCWCD 5 (92%)
|
 |
Lucky J Verma
Ranch Hand
Joined: Apr 11, 2007
Posts: 277
|
|
Answer should be 1 time subclass! only. NOt twice,or is it for you?
|
 |
suresh mulagala
Ranch Hand
Joined: Feb 18, 2003
Posts: 41
|
|
when subclass is intantiated, superclass constructor is called which inturn calls the overridden method() and thus it prints "subclass!" - superclass constructor "subclass!" - subclass constructor
|
 |
 |
|
|
subject: Constructor
|
|
|