Answer Posted / shiry
In C++ ;
if i have 2 clases
class A {
int x();
}
class B : public A {
int x();
}
void main(){
A* a = new B() ;
a.x(); // it will call the method of the super class A
// not B but in java it will call the method in the
// child B why ??
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Difference between overriding and overloading in java?
What is externalizable?
Which collection is ordered in java?
Can we override final method?
Explain the concept of proper inheritance?
How will you add panel to a frame?
Is a boolean 1 bit?
Can we override compareto method?
How to set the permissions to a file in java?
What is protected access modifier?
What is the public field modifier?
What is a locale?
Explain java code for recursive solution's base case?
Is there any limitation of using inheritance?
Can constructor be inherited?