Interface A {
String test();
}
Interface B {
int test();
}
Create a class AB which must implements both A & B
interfaces.
Answer Posted / sailaja
Interface A {
String test();
}
Interface B {
int test();
}
Class AB implements A,B
{
String test()
{
System.out.println("Test");
}
int test()
{ System.out.println("Test1");
}
}
Class Test
{
public static void main(String as[])
{
Interface i=null;
i=new AB();
i.test();
}
}
| Is This Answer Correct ? | 4 Yes | 10 No |
Post New Answer View All Answers
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
Explain covariant method overriding in java.
How to perform bubble sort in java?
Why set is used in java?
What is an infinite loop in java? Explain with an example.
What are methods in java?
What is factor r?
What is pass by value?
What is a generic data type?
What are the topics in advance java?
Explain about core java?
What is string variable?
FOR EXAMPLE WE R HAVING TWO LIST ELEMENTS ..BOTH LISTS CONTAINS ID,NAME,PLACE ..I NEED TO COMPARE BOTH IDS IN TWO LISTS,IF ID'S R SAME MEANS WE HAVE ADD THE DETAILS(LIKE NAME,PLACE) TO MAP...HOW IS POSSIBLE ?CAN ANY ONE SUGGEST?
How do you sort in descending order in java using collections sort?
What is difference between == and === in js?