Can you write Java code for declaration of multiple
inheritance in Java ?

Answers were Sorted based on User's Feedback



Can you write Java code for declaration of multiple inheritance in Java ?..

Answer / supreeth

Class C extends A implements B

Is This Answer Correct ?    19 Yes 2 No

Can you write Java code for declaration of multiple inheritance in Java ?..

Answer / raghu

Hi yes multiple inheritance is possible in Java through
interface.

class A extends B implements interface 1....n

interface a extends interface b.... n.

Is This Answer Correct ?    15 Yes 2 No

Can you write Java code for declaration of multiple inheritance in Java ?..

Answer / manjula

Multiple Inheritance is not allowed in java. Instead of
this, interfaces are used to implement multiple inheritance
concept.

syntax: interface interface_name
{
data & method declaration;
}

The interafaces in java always contain final fields and
abstract methods

Is This Answer Correct ?    11 Yes 1 No

Can you write Java code for declaration of multiple inheritance in Java ?..

Answer / suresh

yes i can by using interfaces it is posible

Is This Answer Correct ?    0 Yes 0 No

Can you write Java code for declaration of multiple inheritance in Java ?..

Answer / 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

Can you write Java code for declaration of multiple inheritance in Java ?..

Answer / basavaraj

s....u can do....

i think u can do by..

writing innerclass n impementing interface...

class A extends B
{
class test2{
}

}


here, test2 is innerclass which can inherits the properies
of A as well as B...

Is This Answer Correct ?    5 Yes 8 No

Post New Answer

More Advanced Java Interview Questions

What’s jboss cache in short?

0 Answers  


What is local interface. How values will be passed?

0 Answers  


What is clustering? What are the different algorithms used for clustering?

0 Answers  


Is “abc” a primitive value?

0 Answers  


iam writing the contents to a excel through I/O i am putting first statement as WRITE and then READ(from excel) immediately..later user complains that he is not getting the date by using READ ..wat could be the situation

3 Answers   iGate,






How task's priority is used in scheduling?

0 Answers   HCL,


Can I use javascript to submit a form?

0 Answers  


what is the use of Object Factories?

1 Answers  


diffrence between jsp and servelts.

6 Answers  


What is a modular application?

0 Answers  


wahts is mean by dynavalidatorform in struts/

0 Answers   SolutionNET,


Thread life cycle?

3 Answers   TCS,


Categories