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
If a class is declared without any access modifiers, where may the class be accessed in java programming?
What is mvc in java?
What is navigable map in java?
Difference between throw and throws?
Does java allow overriding static methods ?
How do you compare objects in java?
Explain static nested classes ?
What are the different types of methodologies?
What is a class object?
What is indexof in java?
What does string mean in java?
What is the difference between interface & abstract class?
What is thread safe in java?
Does java arraylist maintain insertion order?
What are kinds of processors?