Abstract Classes vs Interfaces (Java)

39



Abstract Classes vs Interfaces (Java)

A simple example that demonstrates the use of both Abstract Classes and Interfaces. The two can be used in many different ways, either exclusively or in combination. We chose to keep them separate in order to demonstrate the main differences.

Tag: abstract class vs interface java, java, programming, abstract class, interface

Xem thêm bài viết eSports: https://sherimoonzombie.net/esports

Nguồn: https://sherimoonzombie.net

39 Comments

  1. Димитър Димитров · Edit

    Ok, but it's possible to change the abstract class to do the same as the Interface. If we change the method "paymentForWork", to be abstract and implement it in every subclass, isn't it the same? Or I'm in mistake?

    Reply
  2. Love the video but I just don’t know if I really need to use abstract or interface since it seems to be unnecessarily strict when I can treat a regular class like an interface but have the added convenience of being able to add a little extra background code to methods as well

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *