avoid inheritance in java language
Hello,
You cannot restrict inheritance in Java. But to prevent inheritance, use the keyword "final" when creating the class. The designers of the String class realized that it was not a candidate for inheritance and have prevented it from being extended.
Hope this helps
Thank You