Deepika N
Thnx
Originally posted by Henry Wong:
BTW, I am surprised that the compiler didn't complain that you are using an instance to call a static method.
Henry
Thnx
If a subclass has a constructor, when that subclass is instatiated with, does the compiler call the constructor of the superclass too?
If a subclass has a constructor
Question30Super q31 = new Question30Super();
Question30Super q30 = new Question30();
Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Base B1 = new Sub();
Sub B2 = new Sub();
What is the difference when I call methods from B1 and B2? Does it only affect when calling static methods?
If I override a method in Sub, can I call that method from B1?
If I have a method in Sub, which is not defined in Base, can I call that method from B1?
If I override a static method in Sub, can I call that static method from B1? or is it only from B2 that I can call it?
SCJA, SCJP5.0, SCBCD, SCWCD
Bring me the box labeled "thinking cap" ... and then read this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
|