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 start a new line in java?
Why we use set in java?
What is skeleton and stub? What is the purpose of those?
Name some classes present in java.util.regex package.
What's the purpose of static methods and static variables?
What is the difference between path and classpath variables?
What is internal iteration in java se 8?
What is the difference amongst jvm spec, jvm implementation, jvm runtime ?
What is anti pattern in java?
Which are different kinds of source code?
What is nested loop? What is dangling else condition in it?
Why is the type for real numbers called double?
What is the difference between this() and super() in java?
a thread is runnable, how does that work? : Java thread
What is the use of string and stringbuffer?