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
Is a case study a method or methodology?
Explain about public and private access specifiers?
Can a class extends itself in java?
How will you invoke any external process in java?
What are the differences between processes and threads?
Why bytecode is called bytecode?
How many bits are used to represent unicode, ascii, utf-16, and utf-8 characters in java programming?
What is hash code collision?
What do you mean by append?
What is difference between checked and unchecked exception in java?
Is vector synchronized in java?
What is your platform’s default character encoding?
What does it mean that a class or member is final?
What do you mean by compiler?
Convert a BST into a DLL and DLL to BST in place.