Benefits of implementing an interface

后端 未结 10 1096
小鲜肉
小鲜肉 2020-12-06 04:58

what are the benefits of implementing an interface in C# 3.5 ?

10条回答
  •  执念已碎
    2020-12-06 06:00

    You aren't tied to class inheritance - you can apply an interface to any class. Any class can have multiple interfaces - C# doesn't support multiple class inheritance, i.e. you are providing a good abstraction layer through the interface

提交回复
热议问题