Default implementation of a method for C# interfaces?

后端 未结 6 2032
梦如初夏
梦如初夏 2020-12-24 05:35

Is it possible to define an interface in C# which has a default implementation? (so that we can define a class implementing that interface without implementing that particul

6条回答
  •  难免孤独
    2020-12-24 06:03

    it is possible in C# 8.0. You can add a method with default implementation. You will have to change your target framework version to latest to use this feature.

提交回复
热议问题