Interface A {
String test();
}

Interface B {
int test();
}

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

Answer Posted / menita

interface A
{
String test();
}

interface B
{
int test();
}


public class AB implements B

{

A obj1 = new A(){
public String test()
{
return "";
}
};
public int test()
{
return 0;
}
}

Is This Answer Correct ?    7 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do generics work?

728


How to retrieve data from database in java using arraylist?

771


What is the unit of plancks constant?

806


What java is used for?

851


Enlist few advantages of inheritance?

864


Write a method that will remove given character from the string?

802


Can I import same package/class twice?

712


Why can't you declare a class as protected?

824


Is it necessary that each try block must be followed by a catch block?

802


What is tree node in java?

745


Why is flag used in java?

773


define the terminology association.

895


Is node a data type in java?

752


What are the actions that can occur when a thread enters blocked state?

830


Does substring create a new object?

775