Abstract Method: Abstract Method does not have implementation that is Abstract method has only its name. Its Implementation must be implemented by its subclass. Abstract method must be declare or return in Abstract Class.
Syntax of Abstract Method:
modifier abstract return type method name(argument if any);
Abstract Class: Abstract Class is just associated with Abstract keyword.
Syntax of Abstract Class:
abstract class classname
Properties of Abstract Class:
- Abstract Class cannot be instantiated that is we can not create its object.
- Abstract Class Support 0 to 100% Abstraction.
- Abstract Class can have Constructor, static method, static block, Abstract methods, non-Abstract method that is all things which are in simple class.
- If a class extends the abstract class then that class must be implement the abstract method of abstract class otherwise it give error. If subclass does not want to implement the abstract method of a Abstract class then that class should be declare as abstract.