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 is main function purpose?
What is the static method?
How can I right-justify a string?
What is meant by flickering?
What is ascii code?
What is style and indentation?
What is the difference between a method and a procedure?
Give me some null interfaces in java?
What is vector capacity in java?
What is java in layman terms?
State some advantages of java?
Difference between a class and an object?
What are the two categories of data types in the java programming language?
What does it mean to flush a file?
What is the difference between inner class and nested class?