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 is a line break example?
Define max and min heap, also the search time of heap.
Why pass by reference is not possible in java?
What is floor in java?
What is the largest number a double can hold?
What is function and its uses?
Implement a stack with push (), pop() and min() in O(1) time.
Which is dependent variable?
Define a package.
What are methods?
How to write custom exception in java?
Which package is always imported by default?
What are the disadvantages of object oriented programming?
Where are register variables stored?
What is indexof in java?