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 local variable and global variable?
Explain about serializable interface in java?
Does constructor return any value?
What are the 6 functions?
What is the symbol for average?
Do you know how to reverse string in java?
What is member in java?
When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?
What is the default access specifier for variables and methods of a class?
Explain polymorphism citing an example.
Is java developer a good career?
How do you compare two strings lexicographically?
Can we catch more than one exception in single catch block?
What is singletonlist in java?
What is the function of character?