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


Please Help Members By Posting Answers For Below Questions

What is a session? Can you share a session object between different theads?

555


How to determine SGA site?

1909


How would you reatach detached objects to a session when the same object has already been loaded into the session?

680


Which class is the immediate superclass of the menucomponent class?

629


Write a program to show synchronization?

693






What’s jboss jbpm?

580


What is synchronization and why is it important?

545


What are the different algorithms used for clustering?

550


What is the purpose of the wait() method?

620


Difference between loadclass and class.forname?

599


what are memory considerations of jsp compares to other web components?

6012


Where can I ask questions and make suggestions about seam?

590


Explain RMI Architecture?

608


Why a component architecture for the java platform?

578


What is RMI and what are the services in RMI?

608