Is java supports multiple inheritance? explain?
Answer Posted / 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 |
Post New Answer View All Answers
What is the default size of set in java?
What is the parse method in java?
What is natural ordering in java?
When should I use a singleton?
What is the replace tool?
What do you understand by a Static Variable?
What is the common usage of serialization? What exceptions occur during serialization?
which pattern is default in scanner package?
how to deploy tomcatserver to weblogic server? write d following steps?
Can a static member function access member variable of an object?
How do you use parseint in java?
What are latest features introduced with java 8?
does java support pointers?
What is the difference between Java1.4 and Java1.5
What's the purpose of using break in each case of switch statement?