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
Is java a prime method?
What do bitwise operators do?
Can you declare the main method as final?
What is a byte string?
Is java a super set of javascript?
Tell me a few examples of final classes defined in Java API?
When do we use synchronized methods in java?
what do you understand by synchronization? : Java thread
Can we use switch statement with strings?
Can a class be final?
How do you define a parameter?
how its run?
What does escaping a character mean?
What an i/o filter in java programming?
Can I override protected method in java?