SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Originally posted by Jothi Shankar Kumar Sankararaj:
Originally posted by donald rieck:
From your example above.
A a = new A();
Main m = new Main();
a = m;
"a = m" is the same as " A a = new Main();"
therefore:
It will call the Main method:
hence, print out "From subclass".
Originally posted by Jothi Shankar Kumar Sankararaj:
Hi Above,
It dosn't compile simply because, the reference type is of class A and when you say A a = new Main() and do a.bMethod(), it checks for the method in class A which is not there, so it results in a compile time error.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |