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 is the use of math abs in java?

552


What do you mean by synchronized non access modifier?

569


Is arraylist an object in java?

605


how we can use debug in myeclipse 6.0 in order solve the problems that exist in our program when there are 900 to 1000 pages in a web application

1670


What is the purpose of extern variable?

544






What are the concepts of 'OOPS'?

607


What methodology can be employed to locate substrings inside a string?

534


What are recursive functions?

577


Is java platform independent?

572


what is recursion in java

602


Difference between serialization and deserialization in java?

656


What is the difference between the paint() and repaint() methods?

591


In how many ways we can create threads in java?

635


What is flush buffer?

521


What are the 7 types of characters?

568