c# - Interface overloading -


i have created interface response

interface response{    public output(string s); } 

and implement interface on class a . have class b , need implement interface need different parameter interface method. (mean class b needs public output(comment c);)

so question , need create interface class b because need different parameter

like

 interface response{    public output(comment c); } 

or there way handle this. can used object data type this.?

thank you.

note, answer applies java. not c# expert.

i believe want

public interface response<t> {     void output(t arg); } 

then can write

public class classa implements response<string> {     public void output(string arg) {        // etc 

and also

public class classb implements response<comment>     public void output(comment arg) {        // etc 

Comments