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


Please Help Members By Posting Answers For Below Questions

How do you start a new line in java?

523


Why we use set in java?

519


What is skeleton and stub? What is the purpose of those?

540


Name some classes present in java.util.regex package.

608


What's the purpose of static methods and static variables?

599






What is the difference between path and classpath variables?

532


What is internal iteration in java se 8?

630


What is the difference amongst jvm spec, jvm implementation, jvm runtime ?

507


What is anti pattern in java?

520


Which are different kinds of source code?

662


What is nested loop? What is dangling else condition in it?

574


Why is the type for real numbers called double?

545


What is the difference between this() and super() in java?

543


a thread is runnable, how does that work? : Java thread

513


What is the use of string and stringbuffer?

554