Site Owners Forums - Webmaster Forums

Site Owners Forums - Webmaster Forums (http://siteownersforums.com/index.php)
-   Programming General (http://siteownersforums.com/forumdisplay.php?f=44)
-   -   Why String is final in Java? (http://siteownersforums.com/showthread.php?t=198368)

bhavnasingh482 07-27-2017 01:46 AM

Why String is final in Java?
 
Hi friends,
I would like to know,
Why String is final in Java?

spurtcommerce 02-12-2018 05:12 AM

String is a very core class in Java, many things rely on it working a certain way, for example being immutable. Making the class final prevents subclasses that could break these assumptions. Note that, even now, if you use reflection, you can break Strings (change their value or hashcode).

GeorgeAlbie 02-13-2018 11:40 PM

String is a very core class in Java, many things rely on it working a certain way, for example being immutable. Making the class final prevents subclasses that could break these assumptions. Note that, even now, if you use reflection, you can break Strings (change their value or hashcode)

samaron 02-20-2018 11:20 PM

String is a very core class in Java, many things rely on it working a certain way, for example being immutable. Making the class final prevents subclasses that could break these assumptions. Note that, even now, if you use reflection, you can break Strings (change their value or hashcode).

smmexpertss 02-23-2018 04:07 AM

Once you assign a string object, that object can not be changed in memory. In summary, what you did is to change the reference of "a" to a new string object. Java String is immutable, String will Store the value in the form of object.

samaron 02-26-2018 03:04 AM

String is a very core class in Java, many things rely on it working a certain way, for example being immutable. Making the class final prevents subclasses that could break these assumptions. Note that, even now, if you use reflection, you can break Strings (change their value or hashcode).

adityadev 03-18-2019 03:37 AM

String is a very core class in Java, many things rely on it working a certain way, for example being immutable. Making the class final prevents subclasses that could break these assumptions. Note that, even now, if you use reflection, you can break Strings


All times are GMT -7. The time now is 01:36 PM.


Powered by vBulletin Copyright © 2020 vBulletin Solutions, Inc.