not implementing all of the methods of interface. is it possible?

前端 未结 10 1963
挽巷
挽巷 2020-11-28 03:33

Is there any way to NOT implement all of the methods of an interface in an inheriting class?

10条回答
  •  悲&欢浪女
    2020-11-28 04:28

    It is possible and it is easy. I coded an example.

    All you have to do is inherit from a class that does implement the method. If you don't mind a class that is not instantiable, then you can also define an abstract class.

提交回复
热议问题