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
What is difference between module and function?
What is the file type?
What's the access scope of protected access specifier?
what do you mean by marker interface in java?
What if I write static public void instead of public static void in java?
Explain about static imports in java?
why using interface interface ?
What is an eror in java?
Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.
Can we declare an array without size in java?
Can constructor be protected in java?
What happens if we don’t define serial version uid?
What is a pattern what is an anti pattern?
What is the difference between inner class and nested class?
Variable of the boolean type is automatically initialized as?