Current Android Release version:
Version Code: Pie
Version: 9
API level: 28

Abstract class in Java

A class that is declared with "abstract" keyword is called as abstract class.
A method that is declared as abstract and it does not have implementation is known as abstract method.

abstract class A{} 
abstract void checkStatus(); //no implementation

Important points to remember:
  • abstract classes can not be instantiated but it can be inherited
  • abstract classes can have both abstract and non abstract methods
  • If any one single method is abstract in class then whole class must be declared as abstract

No comments:

Post a Comment