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

What are the main differences between the java platform and other platforms?

535


What is the same as procedures?

542


Why is a constant variable important?

511


What is meant by collection in java?

566


What are drawbacks of singleton class?

533






How do you control extraneous variables?

516


Why is multithreading important?

505


Give differences between Quicksort & Mergesort. When should these sorts be used and what is their running time?

580


What is the purpose of sizeof operator?

540


What is the difference between dom and sax parser in java?

544


write a program that list all permutations of ABCDEF in which A appears before B?

2017


What is unicode with example?

618


Where are the card layouts used?

620


What is a method header?

554


What is the difference between the boolean & operator and the && operator in java programming?

574