I wanted to know whether it is possible to implement code like this?
public interface A {
public void execute();
}
public interface B {
public String execute();
}
class C implements A, B {
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No. This is not allowed, as the compiler would be unable to tell which version of
executeyou want to use.If you want to overload methods, you need to vary the method parameters, e.g.: