Abstract class (Java)

Abstract class definition:

  In object-oriented concept, all objects are drawn by a class.

  But conversely, not all classes are used to describe the object.

  If a class does not contain enough information to describe a specific target, such a class is an abstract class.

Abstract class features:

  1. method only statement is no method body, the method is an abstract method needs to be modified abstract.

Abstract method must be defined in an abstract class, abstract class must also be modified.

  2. An abstract class can not be instantiated. (Because the call abstract method does not make sense)

  3. subclass of abstract class must implement the abstract methods give a specific abstract class, unless the subclasses are abstract.

  4. The abstract class does not necessarily contain an abstract method, but there must be a class abstract methods abstract class.

  The constructor class method (a modified static method) can not be declared abstract methods.

Guess you like

Origin www.cnblogs.com/benon94/p/10972733.html