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

Is list ordered in java?

544


According to java operator precedence, which operator is considered to be with highest precedence?

604


Can you create an object of an abstract class?

555


What is the static method?

571


Is void a return type?

555






What is null in java?

523


Why string is called as immutable?

524


What is hash in java?

523


What is return code?

560


How do you check if two given string are anagrams?

554


Explain what access modifiers can be used for methods?

572


What is the tradeoff between using an unordered array versus an ordered array?

665


What is outofmemoryerror in java?

568


Can we sort a map in java?

578


What is a class object?

500