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
What is the list interface in java programming?
What do you mean by formatting?
List some features of the abstract class.
Explain the difference between call by refrence and call by value?
Is void a data type?
What is the difference between call by reference and call by pointer?
What is singleton class example?
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
What is parsing in grammar?
What is strings in java?
What is an image buffer?
What is nested class?
How many bytes is double?
Differentiate between postfix and prefix operators in java.
What is sizeof in java?