Interface A {
String test();
}

Interface B {
int test();
}

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

Answer Posted / kssrk ramesh

forget about implementing the interface
First of all can we can not have two similar method names
only with return type as different.As per overloaded method
concept it is not acceptable.So inorder to implement the
interfaces we need to do like that which is not acceptable
as per overloaded methods principle and hence compilation
error.

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the size of int?

601


What is an example of a boolean?

571


Can you explain the meaning of aggregation and composition

574


How many arguments can a method have java?

544


Explain the difference between extends thread vs implements runnable in java?

540






What is the private method modifier?

583


What are the steps in the jdbc connection?

574


What is the benefit of inner / nested classes ?

527


How does map works in java?

519


What is the difference between && and & in java?

573


What is the parse method in java?

571


How to connect to a remote database using Applet?

2045


Difference between ‘is-a’ and ‘has-a’ relationship in java?

543


How do you clear a method in java?

544


What is a “stateless” protocol ?

559