Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 are the Class Libraries ?

1042


How does queue work in java?

984


How does singleton class work?

983


Is there any difference between synchronized methods and synchronized statements?

1094


Why set do not allow duplicates in java?

1081


What is a buffer in computer?

994


What is serialization in java?

1058


What are sets in java?

938


How to compare two strings in java program?

1047


Are the imports checked for validity at compile time? Will the code containing an import such as java.lang.abcd compile?

1103


How many bytes is a unicode character?

996


What does split function do in java?

1011


What is public static void main?

1094


What is the independent variable in an experiment?

957


What is Java Package and which package is imported by default?

1090