Can you write Java code for declaration of multiple
inheritance in Java ?
Answer Posted / vikas jaiswal
mainly there is no multiple inheritance in java...
but we can make our program to work like multiple inheritance and it is possible via interface..
interface is blue print of class,it is used to achieve fully abstraction and multiple inheritance in java.
java compiler adds public and abstract keyword before the interface method and public static and final keyword before data members.you can see this via decompile the class.
an interface extends another interface.
class MyClass implements MyInterface1,MyInterface2{}
OR
class MyClass extends ParentClass implements MyInterface1{}
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is a session? Can you share a session object between different theads?
How to determine SGA site?
How would you reatach detached objects to a session when the same object has already been loaded into the session?
Which class is the immediate superclass of the menucomponent class?
Write a program to show synchronization?
What’s jboss jbpm?
What is synchronization and why is it important?
What are the different algorithms used for clustering?
What is the purpose of the wait() method?
Difference between loadclass and class.forname?
what are memory considerations of jsp compares to other web components?
Where can I ask questions and make suggestions about seam?
Explain RMI Architecture?
Why a component architecture for the java platform?
What is RMI and what are the services in RMI?