Is java supports multiple inheritance? explain?

Answers were Sorted based on User's Feedback



Is java supports multiple inheritance? explain?..

Answer / payal

Java supports multiple inheritance via interface

Is This Answer Correct ?    22 Yes 2 No

Is java supports multiple inheritance? explain?..

Answer / vivek dubey

NO java supports Multilevel Inheritance and
not the Multiple Inheritance

Multilevel Inheritance

class A{
}

class B extends A{
}

class c extends B{
}


Multiple Inheritance

class c extends A,B{ // nOt supported
}

Is This Answer Correct ?    17 Yes 0 No

Is java supports multiple inheritance? explain?..

Answer / samuelj/samsjjj@gmail.com

java does not support Multiple inheritance so we can use
Interface
interface contains the abstract methods

Is This Answer Correct ?    9 Yes 0 No

Is java supports multiple inheritance? explain?..

Answer / samuelj/samsjjj@gmail.com

java does not support inheritance so we can use Interface
interface contains the abstract methods

Is This Answer Correct ?    9 Yes 2 No

Is java supports multiple inheritance? explain?..

Answer / vijayhukkeri@gmail.com

No. Java does't support multiple inheritance. It supports
only multilevel inheritance.Multiple inheritance is
possible in interfaces by using implements keyword.
ex: class a
{
----
}
class b extends a
{
----
}
class c extends a,b // this is not possible

ex2: class a
{
----
}
class b implements a
{
----
}
class c implements a,b // possible
{
---
}

Is This Answer Correct ?    9 Yes 4 No

Is java supports multiple inheritance? explain?..

Answer / krishna kumar g.

Java doesn't supports Multiple Inheritence.
Let see the example.
class A
{
void m1()
{
// some code
}
}
class B
{
void m1()
{
// some code
}
}
class C extends A,B
{
void m2()
{ }
public static void main(String[] args)
{
C c=new C();
c.m1();
}
}
If we want to call m1() by using class C object, then
which class method(m1()) will be called.It is unable to
find the which class method(m1()) will be called.
So multiple Inheritence is not posssible.

Is This Answer Correct ?    6 Yes 1 No

Is java supports multiple inheritance? explain?..

Answer / ravikiran

No not in a direct manner but interfaces serves the same
purpose

Is This Answer Correct ?    4 Yes 1 No

Is java supports multiple inheritance? explain?..

Answer / dhawal

Instead of multiple inheritance there is feature called
interface in java.

Is This Answer Correct ?    3 Yes 0 No

Is java supports multiple inheritance? explain?..

Answer / anil singh(kushinagar)

No!. Java support multi_lable,single inheritence but not
multiple inheritence.

Is This Answer Correct ?    2 Yes 0 No

Is java supports multiple inheritance? explain?..

Answer / pk

Ok, then how multiple inheritance can be achieved in java?

Is This Answer Correct ?    5 Yes 4 No

Post New Answer

More Core Java Interview Questions

What 5 doubled?

0 Answers  


Can a variable be local and static at the same time?

0 Answers  


what is the difference between System.exit() and System.exit(1)?

1 Answers   eClinical Solutions, eClinical Works, eClinicalWorks,


I have a String s = java; What is the output when I say s.replaceAll('j', 'k'); Also what is the value of s after replacing?

8 Answers   KPIT,


Can private method static?

0 Answers  






Give us the name of the list layoutmanagers in java?

0 Answers  


Where is the singleton class used?

0 Answers   Cap Gemini,


What is use of a abstract variable?

0 Answers  


What does nextint () do in java?

0 Answers  


What are the differences between forwarding () method and sendredirect() methods?

0 Answers  


What releases of Java technology are currently available? What do they contain?

1 Answers  


What is the difference between pass by reference and pass by pointer?

0 Answers  


Categories