- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Why string objects are immutable in java?
In general, strings are used to represent the vital details like database connection urls, username passwords etc. The immutability of strings helps to keep such details unchanged.
Similarly String is used as argument while loading the class. At that time change in the string may result in loading the wrong class.
If immutable automatically variables (strings) are thread safe.
- Related Articles
- Why string is immutable in Java?
- Why String class is immutable or final in Java?
- Immutable String in Java
- Primitive Wrapper Classes are Immutable in Java
- Name mutable and immutable objects in Python
- What is the meaning of immutable in term of String in java?
- What are the benefits of immutable collections in Java 9?
- Why must dictionary keys be immutable in Python?
- Golang program to make string immutable
- Why are numbers represented as objects in python?
- Are lambda expressions objects in Java?
- How to create immutable class in Java?
- Why are default values shared between objects in Python?
- How Java objects are stored in memory?
- How are Java objects stored in memory?

Advertisements