Is java supports multiple inheritance? explain?
Answers were Sorted based on User's Feedback
Answer / kash
Two types of inheritance in Java:
Class inheritance : A sub class can have only one base class ( Single inheritance). Although the sub class can itself be a base class to another sub class ( Multi level inheritance).
Interface inheritance: interface allows multiple classes to implement abstract methods defined on it ( so supports multiple inheritance)
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / praveenkumar
yes java supports multiple inheritance but not directly.
By implementing single inheritance we can acheive multiple
inheritance.See for example
class A{
some method();
}
class B extends A
{
}
class C extends B
{
}
like tht we can acheive multiple inheritance.
Is This Answer Correct ? | 3 Yes | 18 No |
Explain purpose of sleep() method in java?
Does java linked list allow duplicates?
What is escape analysis algorithm in JVM and how garbage collection actually worked n how it transfer the objects from one kind of space to other?
What are local variables?
What are alternatives to java serialization?
Which method must be implemented by all threads?
how to create multithreaded program? Explain different ways of using thread? : Java thread
What does null mean in java?
What is primitive array?
how to minimize the functionality to will not force garbage collector?
How do you use final keywords and final variables in Java?
why we use merge option in hybernate pls give a ex snippet