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

前端 未结 10 1970
挽巷
挽巷 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:22

    Define that class as an abstract class. However, you must implement those unimplemented methods when you want to create an instance of it (either by using a subclass or an anonymous class).

提交回复
热议问题