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 permgen or permanent generation?
what are the advantages of JTA over JTS?
In RMI, inorder to sent the stub reference to the client, is we have to load the server object first into the memory or can we directly sent reference to the client?
What are the steps to write p-to-p model application?
When a thread blocks on i/o?
What are the sequence of steps to write pub or sub model kind of application?
Name the eight primitive java types.
How messaging services are done, before release of JMS?
Which class is the immediate superclass of the menucomponent class?
What is abstract schema?
difference between ejb,struts,hibernate,spring and jsp
What is TL and its use?
What is jboss?
What is the infobus?
Describe, in general, how java's garbage collector works?