What is abstract method, abstract class in Java?

Methods are declared abstract in a super class to make sure that a sub class must overrides a super class and not just simply use the way they are declared in the super class.

Abstract method is declared as:

abstract type name(parameter_list);

Abstract class is the one which uses any abstract method. Abstract class doesn’t have any objects, it can’t use a new operator, it doesn’t have abstract constructors and abstract static methods.

Syntax of abstract class:

abstract class class_name{

abstract type name(parameter_list);

body of abstract class;


Leave a Reply