Answer Posted / ujas doshi
No...Actually java does not support multiple inheritance.
You can say bcoz of reason mentioned by debapriya.
But if you want a class to be inherited from 2 classes you
can use a concept in java called interfaces..
class C extends A, extends B ---wrong, error, only one
class can be inherited
class C implements A, implements B ---fine, here A and B
are not classes but they are interfaces.
Now what are interfaces?
interfaces are similar to classes except a few things
1)Interfaces must contain static methods only
| Is This Answer Correct ? | 17 Yes | 10 No |
Post New Answer View All Answers
What does s mean in regex?
How many unicode characters are there?
What is oop principle in java?
Where is stringbuffer stored?
What are inbuilt functions in java?
What are different types of classloaders?
Outline the major features of java.
Why collection doesn’t extend cloneable and serializable interfaces?
Explain spliterator in java8?
Does collectionutils isempty check for null?
How does enum work in java?
What is method overloading in java ?
Explain the difference between association, aggregation and inheritance relationships.
How to stop a thread in java? Explain about sleep () method in a thread?
what are the states associated in the thread? : Java thread