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

rest - Spring boot: Request method 'PUT' not supported -

php - Magento - Deleted Base url key -

symfony - imagine_filter() not generating the correct url in LiipImagineBundle -