Benefits of implementing an interface

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

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

10条回答
  •  隐瞒了意图╮
    2020-12-06 05:39

    An Interface is a reference type and it contains only abstract members. Interface's members can be Events, Methods, Properties and Indexers. But the interface contains only declaration for its members. Any implementation must be placed in class that realizes them. The interface can't contain constants, data fields, constructors, destructors and static members. All the member declarations inside interface are implicitly public.

提交回复
热议问题