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
Explain about sets?
What are thread local variables?
What is difference between c++ and java ?
Does java set allow duplicates?
When arithmeticexception is thrown?
How many times finalize method will be invoked? Who invokes finalize() method in java?
What is the final keyword denotes?
What are the differences between Java 1.0 and Java 2.0?
What is finalize()?
What is class variable java?
What is an immutable class?
How does a for loop work java?
What is the purpose of a parameter?
Explain constructors and types of constructors in java.
What 5 doubled?