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
What is the destroy method?
Is 0 a real number?
What are nested classes in java?
What’s a deadlock?
Is cout buffered?
Explain the difference between transient and volatile in java?
What is not object oriented programming?
Do we have pointers in java?
What is a constructor overloading in java?
What is the difference between access specifiers and access modifiers in java? 16
Can constructor be inherited?
Is array passed by reference in java?
What is multithreading in java?
What is an infinite loop?
Why do we override tostring method in java?