Interfaces and Abstract classes confusion in Java with examples

后端 未结 7 930
佛祖请我去吃肉
佛祖请我去吃肉 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.

    0 讨论(0)
提交回复
热议问题