Child cObj = new Parent()
Wahts the output ?
Answer Posted / giri
You can write below ways [Upcasting].
Child *cObj = new Parent();
Is This Answer Correct ? | 5 Yes | 10 No |
Post New Answer View All Answers
What is advantage of inheritance?
Which is better struts or spring?
Write a program to sort the number with different sorts in one program ??
Can static class have constructor?
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 abstraction in oop?
What is class in oop with example?
What is the difference between abstraction and polymorphism?
Who invented oop?
What are two types of polymorphism?
What is an advantage of polymorphism?
Why interface is used?
What are the data types in oop?
Why do we use polymorphism?
Write a java applet that computes and displays the squares of values between 25 and 1 inclusive and displays them in a TextArea box