An interface with different method parameters
class, interface, java
Solution
you could make an operand-object
public interface Operation {
public int Add(Operand o);
}
or
public interface Operation {
public int Add(Operand... o);
}
Problem
I want to declare an interface be use with several classes this classes have method with different parameters interface: ``` public interface Operation { public int Add(); } ``` class A: ``` public class CLASSA implement Operation{ public int Add(int id,String name); } ``` class B: ``` public class CLASSB implement Operation{ public int Add(String name); } ``` how to impelement of this interface?