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
Why does it take so much time to access an applet having swing components the first time?
List out benefits of object oriented programming language?
What are the main differences between the java platform and other platforms?
What is a literal coding?
What is percentage in java?
Can a set contain duplicates?
What is collections framework?
What is lazy initialization in java?
What is a short in java?
State the merge-sort principle and its time complexity.
What is complexity and its types?
What is class level lock ?
Can main() method in java can return any data?
What is java instanceof operator?
What is local variable and instance variable?