adspace
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
How to create a base64 decoder in java8?
What is a classloader in java?
explain different ways of using thread? : Java thread
What is java string pool?
Write a program to print count of empty strings in java 8?
Explain public static void main(string args[]) in java.
Differentiate between static and non-static methods in java.
What are the differences between heap and stack memory in java?
Write a program to find the whether a number is an Armstrong number or not?
What is parsing in java?
What is the difference between equals() and == in java?
Is minecraft 1.15 out?
Realized?
What is an object in java and how is it created?
What do you mean by an interface in java?