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 oops with example?
When not to use object oriented programming?
Why multiple inheritance is not allowed?
What is constructor overloading in oop?
What is abstraction in oop?
Is abstract thinking intelligence?
What is interface? When and where is it used?
What is the highest level of cohesion?
Why is encapsulation used?
Why is abstraction needed?
How does polymorphism work?
What is abstraction and encapsulation?
What are objects in oop?
How is class defined?
What is a class and object?