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
What do you mean by boolean?
What does a boolean method return?
How to implement an arraylist in java?
What is the transient keyword?
How to display names of all components in a Container?
What does microservices mean?
What are the differences between forwarding () method and sendredirect() methods?
What is exception in java?
Explain about sets?
String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?
Can we serialize singleton class?
What is an abstract method in java programming?
What are the features of java?
What is a package in java? List down various advantages of packages.
What about features of local inner class?