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 difference between inheritance and polymorphism?
Can bst contain duplicates?
What is oops and its features?
Why do we use oops?
What is the point of polymorphism?
What is polymorphism what are the different types of polymorphism?
How many human genes are polymorphic?
What are properties in oop?
What is oops concept with example?
What does <> mean pseudocode?
Can destructor be overloaded?
What is and I oop mean?
if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?
class CTest { public: void someMethod() { int nCount = 0; cout << "This is some method --> " << nCount; } }; int main() { CTest *pctest; pctest->someMethod(); return 0; } It will executes the someMethod() and displays the value too. how is it possible with our creating memory for the class . i think iam not creating object for the class. Thanks in Advance... Prakash
What is the point of oop?