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
Are there books about seam?
What is a session? Can you share a session object between different theads?
Define prototype?
Why are my checkboxes not being set from on to off?
What is in-memory replication?
Can I import same package/class twice? Will the jvm load the package twice at runtime?
What if the static modifier is removed from the signature of the main method?
Difference between DurableSubscription and non- DurableSubscription?
Is there a guarantee of uniqueness for entity beans?
Is infobus easy to use?
In our urls and in the text of the buttons we have comma. Its causing an error. Is there a way to change the delimiting character for the menu arguments?
What is the highest-level event class of the event-delegation model?
Explain the difference between object state and behavior?
What’s jboss jbpm?
Why is actionform a base class rather than an interface?