Child cObj = new Parent()
Wahts the output ?
Answer Posted / austin j seelan
Child cObj = new Parent()
This will through the compiletime error.
but we can create an instance like the foll.way
parent objparent = new child()
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
What is cohesion in oop?
What is a superclass in oop?
What is the types of inheritance?
Why is polymorphism used?
What is difference between multiple inheritance and multilevel inheritance?
Why do pointers exist?
Can we create object of abstract class?
How do you answer polymorphism?
What is oops and its features?
What is encapsulation and abstraction? How are they implemented in C++?
What is difference between data abstraction and encapsulation?
What is the oops and benefits of oops programming?
Advantage and disadvantage of routing in telecom sector
What is the significance of classes in oop?
What is the diamond problem in inheritance?