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
When can we say that threads are not lightweight process in java?
what r advatages of websphere? & how to deploy?
What is the difference between jdk and jre?
What are "methods" and "fields"?
Explain yield() method in thread class ?
If I don't provide any arguments on the command line, then what will the value stored in the string array passed into the main() method, empty or null?
What is use of set in java?
What is a static method in java?
What is the escape character in java?
What is super?
Where is jre installed?
Write a program to find the whether a number is an Armstrong number or not?
Which collection does not allow duplicates in java?
Explain illegalmonitorstateexception and when it will be thrown?
What package is math in java?