Interface A {
String test();
}
Interface B {
int test();
}
Create a class AB which must implements both A & B
interfaces.
Answer Posted / sumit
interface A {
String test();
}
interface B {
int test();
}
class AB implements A
{
public String test()
{ System.out.println("Test1 in AB");
return "a";
}
}
class Test
{
public static void main(String as[])
{
AB i = new AB();
B b = new B(){
public int test()
{
System.out.println("Test");
return 1;
}
};
i.test();
b.test();
}
}
| Is This Answer Correct ? | 3 Yes | 5 No |
Post New Answer View All Answers
What is thread count in java?
Where is const variable stored?
What is equlas() and hashcode() contract in java? Where does it used?
What is variable and example?
Explain about abstract classes in java?
What is r in java?
What are the different http methods?
What is meant by bytecode?
What is consumer in java?
Which class is the superclass of all classes?
Why is it called buffering?
What is regex java?
Which sorting algorithm is in place?
What are the advantages of autoboxing?
What are three ways in which a thread can enter the waiting state in java programming?