java - An interface with different method parameters -
i want declare interface utilize several classes classes have method 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 impelement of interface?
you create operand-object
public interface operation { public int add(operand o); }
or
public interface operation { public int add(operand... o); }
java class interface
No comments:
Post a Comment