Java interface with different method parameters

Viewed 11678

I want to have an interface that allows me to use methods with different parameters. Suppose I have an interface:

public interface Stuff {
    public int Add();
 }

And I have two classes A and B who implement the interface.

public class CLASS A implements Stuff{
    public int Add(int id);
}  


public class CLASS B implements Stuff{
    public int Add(String name);
}

How can I achieve this?

3 Answers
Related