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
Can we use switch statement with strings?
Is java 1.7 the same as java 7?
What is the locale class in java programming?
Can constructor return value?
Hi Anyone know the model / questions of the Federal bank sample questions for the post of Specialist Officers - Programmers. Please post if anyone have..
Can we override the static methods?
What is an exception in java?
How is java hashmap implemented?
Which is bigger float or double?
Write a program to show whether a graph is a tree or not using adjacency matrix.
What is java developer skills?
Describe the various concepts related to object oriented programming (oop).
Is heap stored in ram?
What is enhanced loop in java?
Explain what are final variable in java?