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 do you need to set-up a cluster with jboss?
What modifiers may be used with an inner class that is a member of an outer class?
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?
How can I avoid validating a form before data is entered?
Do you think that java should have had pointers?
What is prototype?
Why are my checkboxes not being set from on to off?
Write a singleton program?
Difference between hashmap and hashtable?
Where can I find seam examples and documentation?
What is RMI and what are the services in RMI?
What are local interfaces? Describe.
To identify IDL language what mapping mechanism is used?
what is the use of State Factories?
What are externizable interface?