Tony Alicea
Senior Java Web Application Developer, SCPJ2, SCWCD
Thanks,<br />Thiru<br />[SCJP,SCWCD,SCBCD]
best regards,<br />Steven<br />SCJP, SCEA
For your publicly displayed name,
use a first name, a space, and a last name.
Rob
SCJP 1.4
1. Incorrect 'cuz compiler compiles it
2. Correct 'cuz there is no construtor in B, so compiler inserts a default constructor super(), which calls public A() of A. No need to look at C 'cuz it has to go through B constructors to call A constructors.
3.Correct 'cuz I just counted them.
4. Incorrect as 'this()' makes you call more than one constructor of same class.
This is an explanation from a beginner so experts please verify and give your blessing to my answers
If I construct an object of Class C through the overloaded constructor,
public C(String msg) { this(); }
I would have invoked two constructors of class C.
Thus the above statement cannot be correct.
I think answer B,C and D are correct.
Rob
SCJP 1.4
Originally posted by Rob Ross:
Holy Mackeral, a triple whammy!!
Thanks,<br />Thiru<br />[SCJP,SCWCD,SCBCD]
Originally posted by Corey McGlone:
Too bad those posts are from 2 years ago...somehow, I doubt those names will get changed...
Rob
SCJP 1.4
Hug your destiny! And hug this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|