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
How do you avoid global variables?
What is final?
Is 0 a prime number?
Is vector ordered in java?
What is the difference between sleep and wait in java?
What is byte data type?
Why java is a platform independent? Explain
What are the disadvantages of object oriented programming?
How will you invoke any external process in java?
What are latest features introduced with java 8?
What is numel matlab?
What is == and === in javascript?
Describe how to implement singleton design pattern in struts.
What are three types of loops in java?
What is meant by 'bit masking' in java?