

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 Questions & Answers
- 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
- Why are numbers represented as objects in python?
- What are the benefits of immutable collections in Java 9?
- Are lambda expressions objects in Java?
- Why do you think tuple is an immutable in Python?
- What is the meaning of immutable in term of String in java?
- Which data types are immutable in Python?
- Why are interfaces introduced in Java?
- How are Java objects stored in memory?
- How Java objects are stored in memory?
- Why variables are declared final in Java
- How to create immutable class in Java?
Advertisements