String cannot be extended

An immutable class should be declared final to avoid extensibility. However, developers need to extend the String class in order to add more features, and this limitation can be considered a drawback of immutability.

Nevertheless, developers can write utility classes (for example, Apache Commons Lang, StringUtils, Spring Framework, StringUtils, Guava, and strings) to provide extra features and simply pass strings as arguments to the methods of these classes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.123.155