- 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 is 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 an 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 class is immutable or final in Java?
- Why string objects are immutable in java?
- Immutable String in Java
- What is the meaning of immutable in term of String in java?
- Why do you think tuple is an immutable in Python?
- Why String literal is stored in String Constant Pool in Java?
- Why must dictionary keys be immutable in Python?
- Golang program to make string immutable
- What is the difference between a mutable and immutable string in C#?
- Primitive Wrapper Classes are Immutable in Java
- How to create immutable class in Java?
- What is immutable in Python?
- Why String class is popular key in a HashMap in Java?
- Create and demonstrate an immutable collection in Java
- How to create the immutable class in Java?

Advertisements