如何在具有多种方法的接口中仅实现一种方法? [英] How to implement only one method in interface which having multiple method ?
本文介绍了如何在具有多种方法的接口中仅实现一种方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在接口中仅实现一个具有多个方法的方法?
How to implement only one method in interface which having multiple method ?
推荐答案
可以定义所有方法,但仅实现所需的一种.未使用的主体将仅包含一个 引发新的NotSupportedException()" .
Maybe define all of the methods, but implement the required used one only. The body of unused ones will contain just a ‘throw new NotSupportedException()’.
这篇关于如何在具有多种方法的接口中仅实现一种方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文