...

/

Abstract Classes and Methods

Abstract Classes and Methods

Learn about abstract classes and methods.

Abstract methods

A method with the keyword abstract in its declaration is known as an abstract method.

Rules to be followed

  • In contrast to a concrete/normal Java method an abstract method does not have a body/definition i.e. it only has a declaration or method signature inside an abstract class or an interface.

  • An abstract method can be declared inside an abstract class or an interface only.

  • In other words, it can be said that to contain any abstract method in its implementation a class has to be declared as an abstract class because non-abstract classes cannot have ...