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
Explain different types of wrapper classes in java?
Why strings in java are called as immutable?
Which category the java thread do fall in?
What are keywords and reserved words in java?
What is array size in java?
What do you understand by access specifiers in Java?
Can we change the scope of the overridden method in the subclass?
Which types of exceptions are caught at compile time?
Why array is used in java?
How can we create a thread in java?
What is the difference between preemptive scheduling and time slicing?
What does jre stand for?
Where and how can you use a private constructor?
What is the purpose of interface?
What is JDBC Driver interface?How can you retrieve data from the ResultSet