Answer Posted / aman kr. aggarwal
well as in c++ we have multiple inheritance, but not in java
becz if it is their then having method of same signature
(means same return type, list of paraments, access
specifiers) in 2 different classes and both r extended by
some class AA then while calling method in base class, it
would break down the jvm that to which classes method to be
called.
EX:-
class BB
{
public void a(int x)
{
System.out.println("call from BB");
}
}
class CC
{
public void a(int x)
{
System.out.println("call fro CC");
}
}
class AA extends BB,CC
{
a(5);
}
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
Does constructor be static?
Can we overload the methods by making them static?
Can we extend private class in java?
What are the main uses of java?
Why java strings are immutable in nature?
What is the purpose class.forname method?
Are arrays immutable in java?
Is set thread safe java?
What is constructor chaining and how is it achieved in java?
What is a layout manager and what are different types of layout managers available in java awt?
What are the java ide’s?
Is constructor inherited?
Is a method a procedure?
Is this valid in java ? Can we instantiate interface in java?
Is java se free?