Interface A {
String test();
}

Interface B {
int test();
}

Create a class AB which must implements both A & B
interfaces.

Answer Posted / sumit

interface A {
String test();
}

interface B {
int test();
}

class AB implements A
{


public String test()
{ System.out.println("Test1 in AB");
return "a";
}
}
class Test
{
public static void main(String as[])
{

AB i = new AB();
B b = new B(){
public int test()
{
System.out.println("Test");
return 1;
}
};
i.test();
b.test();
}
}

Is This Answer Correct ?    3 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the list interface in java programming?

580


What do you mean by formatting?

544


List some features of the abstract class.

587


Explain the difference between call by refrence and call by value?

557


Is void a data type?

534






What is the difference between call by reference and call by pointer?

497


What is singleton class example?

585


Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me

1358


What is parsing in grammar?

554


What is strings in java?

585


What is an image buffer?

531


What is nested class?

563


How many bytes is double?

546


Differentiate between postfix and prefix operators in java.

637


What is sizeof in java?

555