Interfaces and Abstract classes confusion in Java with examples

后端 未结 7 935
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-25 13:55

I\'m having trouble understanding when to use an interface as opposed to an abstract class and vice versa. Also, I am confused when to extend an interface with another inter

7条回答
  •  不思量自难忘°
    2020-12-25 14:45

    Use an abstract class when you want to make one or more methods not abstract.

    If you want to keep all abstract, use an interface.

提交回复
热议问题