We can restrict inheritance for a class by the following steps:
By using the final keyword
If we make all methods final, then we cannot override that
By using private constructors
By using the Javadoc comment (" // ")