Why can't we instantiate an interface or an abstract class in java without an anonymous class method?

前端 未结 3 1010
我在风中等你
我在风中等你 2020-12-09 13:00

I know, we can not instantiate either an interface or an abstract class in java except using anonymous class method but what is the reason behind it?

3条回答
  •  生来不讨喜
    2020-12-09 13:44

    You can't instantiate interfaces or abstract classes because some of their methods might not have any definitions.

提交回复
热议问题