Interface A {
String test();
}

Interface B {
int test();
}

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

Answers were Sorted based on User's Feedback



Interface A { String test(); } Interface B { int test(); } Create a class AB which must im..

Answer / akhil agarwal

Interface A
{
string test();
}
Interface B
{
int test();
}
class AB implements A,B
{
string test();
int test();
}

Is This Answer Correct ?    0 Yes 2 No

Interface A { String test(); } Interface B { int test(); } Create a class AB which must im..

Answer / 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

Interface A { String test(); } Interface B { int test(); } Create a class AB which must im..

Answer / srinivasa

Class AB Implements A,B{
String test(){
SOS("----");
}
int test(){
SOS("--------");
}
}

Is This Answer Correct ?    1 Yes 4 No

Interface A { String test(); } Interface B { int test(); } Create a class AB which must im..

Answer / niltarlekar

public class AB implements A,B
{
public static void main(String args[])
{

}
}

Is This Answer Correct ?    0 Yes 4 No

Interface A { String test(); } Interface B { int test(); } Create a class AB which must im..

Answer / sailaja

Interface A {
String test();
}

Interface B {
int test();
}

Class AB implements A,B
{
String test()
{
System.out.println("Test");
}
int test()
{ System.out.println("Test1");
}
}
Class Test
{
public static void main(String as[])
{
Interface i=null;

i=new AB();
i.test();
}
}

Is This Answer Correct ?    4 Yes 10 No

Interface A { String test(); } Interface B { int test(); } Create a class AB which must im..

Answer / nitin gupta

Menita you are absolutely correct!!

Is This Answer Correct ?    0 Yes 8 No

Interface A { String test(); } Interface B { int test(); } Create a class AB which must im..

Answer / sandeep vudutala

interface A
{
String test();
}

interface B extends interface A
{
int test();
}

public Class AB implements B

{

public String test()
{

}

public int test()
{
}

}

Is This Answer Correct ?    5 Yes 23 No

Post New Answer

More Core Java Interview Questions

What is static class

0 Answers   EDS,


why are wait(), notify() and notifyall() methods defined in the object class? : Java thread

0 Answers  


What does  mean in regex?

0 Answers  


class A{ m2(){ } } class B extends A{ m2(){ } } class c extends B{ m2(){ } } class my_class extends c{ m2(){ } pulic static void main(){ ...My_class a = new my_class(); super.super.super.m2(); is this is leagal if not find what is the legal procedure in order to call A's version of m2(); }

8 Answers   Logica CMG,


What are the java ide's? Explain

0 Answers  






What access modifiers can be used for variables?

0 Answers  


relation between list and linked list

1 Answers   Infosys,


Why string is not thread safe?

0 Answers  


Can we overload the constructors?

0 Answers  


How do you remove duplicates from an array in java?

0 Answers  


How do I compare two strings in word in java?

0 Answers  


Define how can we find the actual size of an object on the heap?

0 Answers  


Categories