adspace


Does Java support multiple Inheritance?

Answer Posted / divyesh chauhan

yes java do not support multiple inheritance but we can achieve multiple inheritance using concept of interface implementation in class
for e:g
interface my
{
public void show();
}
interface my1 extends my
{
void disp();
}
class child implements my1
{
public void show()
{
System.out.println("hello java");
}
public void disp()
{
System.out.println("hello disp");
}
public static void main(String...a)
{
my m1=new child();
m1.disp();
m1.show();
}
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a base64 decoder in java8?

1144


What is a classloader in java?

1092


explain different ways of using thread? : Java thread

1087


What is java string pool?

1088


Write a program to print count of empty strings in java 8?

1091


Explain public static void main(string args[]) in java.

1082


Differentiate between static and non-static methods in java.

1131


What are the differences between heap and stack memory in java?

1150


Write a program to find the whether a number is an Armstrong number or not?

1106


What is parsing in java?

1046


What is the difference between equals() and == in java?

1046


Is minecraft 1.15 out?

1049


Realized?

2269


What is an object in java and how is it created?

1146


What do you mean by an interface in java?

1105