Why is String final in Java?

Posted by Alex on Stack Overflow See other posts from Stack Overflow or by Alex
Published on 2010-01-15T01:15:16Z Indexed on 2010/04/22 12:53 UTC
Read the original article Hit count: 225

Filed under:
|
|

From when I learned that the class java.lang.String is declared as final in Java, I was wondering why is that? I didn't find any answer back then, but this post: How to create a replica of String class in Java? reminded me of my query.

Sure, String provides all the functionality I ever needed, and never thought of any operation that would require an extension of class String, but still you'll never know what someone might need!

So, does anyone know what was the intent of the designers when they decided to make it final?

See also: Why is String a sealed class in C#?

© Stack Overflow or respective owner

Related posts about java

Related posts about final