Child cObj = new Parent()
Wahts the output ?
Answer Posted / donga bangarraju
sorry for the earlier post, this output is giving error like
initializing cannot convert to Paretn* to Child*, if u want
correct this code write like this, this is downcasting or
using RTTI mechanism in C++;
Parent* p =new Child;
Child* obj= dynamic_cast<Child*>(p);
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Can main method override?
How do you use inheritance in unity?
What is the purpose of polymorphism?
What is difference between oop and pop?
which feature are not hold visual basic of oop?
What is interface in oop?
Can private class be inherited?
What is polymorphism what is it for and how is it used?
What is abstract class in oop?
Is html an oop?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
What is advantage of inheritance?
What do you mean by Encapsulation?
Write a program to reverse a string using recursive function?
why reinterpret cast is considered dangerous?