avoid inheritance in java language
Answer (1)
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
Comments (0)
Related Questions
static meaning in java language
65 Views
method overloading in java language
37 Views
methods overriding in java language
40 Views
packages offered in java language
28 Views




