The difference between Java abstract class, ordinary class and interface

one, concept

  1. Abstract class: Both ordinary classes and abstract classes can be inherited, but after the abstract class is inherited, the subclass must override the inherited method, unless the self class is also an abstract class.

  2. Ordinary classes: Ordinary classes can be instantiated and invoked; abstract classes cannot be instantiated because it exists in a concept rather than concrete.

  3. Interface:

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324843825&siteId=291194637