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
What is multilevel inheritance explain with example?
What is multilevel inheritance?
What does and I oop mean?
What does and I oop mean in text?
What is meant by oops concept?
How do you define a class in oop?
Why is oop better than procedural?
What is a superclass in oop?
What is static in oop?
Templates mean
What is constructor in oop?
Can destructor be overloaded?
What is class and object in oops?
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(); }
What is encapsulation in oop?