Answer Posted / ashokmail
By using interface you can do multiple inheritance in java.
Example :
interface student{
public void add();
}
public class clloge implements student{
public clloge(){
}
public void add(){
// Some codes
}
}
public class croom implements student{
public croom(){
}
public void add(){
// Some codes
}
}
Using Interface..
public void uinter {
private student[3] stu ;
public uinter(){
stu[0] = new croom();
stu[1] = new clloge()
stu[2] = new croom();
for(int i=0;i<3;i++)
stu[i].add();
}
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What are the escape sequences in java?
Difference between abstract and concrete class ?
What is function declaration?
Why do we need autoboxing in java?
What are the different types of garbage collectors in java?
What is a superclass?
What are three advantages of using functions?
Can a constructor have different name than a class name in java?
Explain what pure virtual function is?
What is udp in java?
What is the declaration statement?
Why does java not support operator overloading?
What is the point of polymorphism java?
Can we increase array size dynamically in java?
Will minecraft java be discontinued?