- A class with the abstract keyword is known as an abstract class.
- It can have abstract and non-abstract methods which means with and without methods.
- It needs to be extended and its method can be implemented.
- It cannot be instantiated.
- It can have constructors, static methods, and final methods which will force the subclass not to change the body of the method.
- An abstract class can have an abstract and non-abstract method
Program
Output:
A non-abstract method is also called a concrete method. An abstract method cannot be used in an interface and it must have an implementation which means a method body the below example illustrates the use of abstract and non-abstract methods in a class
Output: