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
I want to print “hello” even before main is executed. How will you acheive that?
What is a method signature java?
Explain what access modifiers can be used for methods?
How do you start a thread?
Define how does a try statement determine which catch clause should be used to handle an exception?
What is meant by method overriding?
How to retrieve data from database in java using arraylist?
What is sortedmap in java?
Which class is the superclass for every class in java programming?
Can we assign null to double in java?
How do you write a scanner class in java?
Can the garbage collection be forced by any means?
What is scope of a variable?
What is complexity in java?
Why strings in java are called as immutable?