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
Why is it called buffering?
How does multithreading take place on a computer with a single cpu?
What is the flag in java?
What is maximum size of arraylist in java?
What do you mean by ordered and sorted in collections in java?
What is Applet Stub Interface ?
Explain JMS in detail.
What is a method header?
How many bytes is a unicode character?
How do you remove an object from an arraylist in java?
What is difference between == and === in js?
Tell us something about set interface.
What are the differences between Java 1.0 and Java 2.0?
What is the access scope of a protected method?
What is externalizable interface?