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
Why a client should be multithreading? Explain.
What is Remote Server?
What is meant by method chaining?
If we opened Windows Internet Explorer 4 times, does it starts 4 processes or 4 threads?
What is RMI and what are the services in RMI?
Explain what is orm?
A user of a web application sees a jsessionid argument in the URL whenever a resource is accessed. What does this mean? a. The form must have the field jsessionid b. URL rewriting is used as the session method c. Cookies are used for managing sessions
What are the different class loaders used by jvm?
What is the highest-level event class of the event-delegation model?
whats is mean by connectionpooling
Can I import same package/class twice? Will the jvm load the package twice at runtime?
How would you detect a keypress in a jcombobox?
What is the purpose of the wait(), notify(), and notifyall() methods?
What do you need to set-up a cluster with jboss?
What state does a thread enter when it terminates its processing?