SCJP5
Thanks&Regards, Krishna.
SCJP1.4, SCWCD1.4, SCBCD 5.0
Thanks&Regards, Krishna.
SCJP1.4, SCWCD1.4, SCBCD 5.0
after that it comes to Derived class constructor again there is a call to addValue() method again it will call addValue() method of Base class(not Derived addValue() because object is not at all existed for Derived class as we are in Derived class constructor.)
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
All the super classes(chained ones) of the subclass will be initialized before subclass instance is created.
If Parent class method isn't overridden in the Child class, then that Parent class method is invoked at run-time for the instance of Child class too!
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by madhu v pe:
when base class reference is pointing to Derived class object, if derived class is overloading base class method, always base class method will be called.
simply overloading method calling depends on the Base class
overriding method calling depends on the Derived class
SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Originally posted by Raghavan Muthu:
Can you just explain the invocation steps (8 statements) you had given?
SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|