why java does not support multiple inheritance
Answer Posted / mythili pulluru
Java does not support a multiple inheritance because of following reason. for example class A
{
}
class B ExtendsA
{
//variables and methods
}
class c ExtendsA
{
//variables and methods
}
class B ExtendsA
{
//variables and methods
}
class D Extends B,C
{
//variables and methods
}
to compile this program it will give a compile time error because of class D felt in a confusion between B,C which class member to be a inherited(two class having same members) .to avoid this confusion java does not support multiple inheritance.
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain differences between checked and unchecked exceptions in java?
Describe different states of a thread.
What is main difference between variable and constant?
What is namespace in java?
What are loops in java?
Which list does not allow duplicates in java?
What is style and indentation?
What is keyword auto for?
Explain the difference between jvm and jre?
Difference between notify() method and notifyall() method in java?
What are the types of inner classes (non-static nested class) used in java?
give an example for encapsulation?
What is double parsedouble in java?
What are the important features of Java 8 release?
What are user defined exceptions?