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 the scope of a variable.
If you do not want your class to be inherited by any other class. What would you do?
What is the purpose of default constructor?
How do you join strings in java?
what is heap memory?
explain autoboxing in java?
what is predefined function in java?
What occurs when an object is constructed?
What is the base class for error and exception?
What is the default execution method in java?
What are the restrictions that are applied to the java static methods?
What are implicit objects in java?
Is there a way to increase the size of an array after its declaration?
Is set sorted in java?
Why scanner is used in java?