Child cObj = new Parent()
Wahts the output ?

Answer Posted / chetan

it will execute without an error. if Parent class is
parent/base class and child is the child/drive class which
inherit parent class.
In the other worlds you are invoking drive class method with
the reference of base class.

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is multilevel inheritance explain with example?

628


What is multilevel inheritance?

727


What does and I oop mean?

615


What does and I oop mean in text?

625


What is meant by oops concept?

612






How do you define a class in oop?

628


Why is oop better than procedural?

604


What is a superclass in oop?

670


What is static in oop?

591


Templates mean

1589


What is constructor in oop?

589


Can destructor be overloaded?

599


What is class and object in oops?

611


What is Difference Between Inheritance and creating object and getting data? means Class A extends B{ B.getMethod();} (OR) Class A{ b obj=new B(); obj.getMethod(); }

1988


What is encapsulation in oop?

607