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
Write a program to show synchronization?
Can I import same package/class twice? Will the jvm load the package twice at runtime?
What modifiers may be used with an inner class that is a member of an outer class?
Whats new with the stop(), suspend() and resume() methods in jdk 1.2?
Why use POJO when I can use hashmap
whats is mean by connectionpooling
For which statements does it make sense to use a label?
Which containers use a border layout as their default layout?
How to pass parameters in RMI?
Is jvm a overhead?
What value does readline() return when it has reached the end of a file?
What is the argument type of a programs main() method?
Do we need to override service() method
What is a policy?
What is metaspace?