c# - Two interfaces have same method -
interface { int add(int a,int b); } interface b { int add(int a,int b); } class d : a, b { int add(int a,int b) { return a+b; } }
code works fine , didn't produce error. class d using interface's method?
neither, since neither interface has method, merely method signature. method in d implements signature provided both interfaces, works.
remember, interface merely specifies signatures of methods must exist in implementation.
Comments
Post a Comment