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
What are the main differences between the java platform and other platforms?
What is the same as procedures?
Why is a constant variable important?
What is meant by collection in java?
What are drawbacks of singleton class?
How do you control extraneous variables?
Why is multithreading important?
Give differences between Quicksort & Mergesort. When should these sorts be used and what is their running time?
What is the purpose of sizeof operator?
What is the difference between dom and sax parser in java?
write a program that list all permutations of ABCDEF in which A appears before B?
What is unicode with example?
Where are the card layouts used?
What is a method header?
What is the difference between the boolean & operator and the && operator in java programming?