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

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -