Why is String class considered immutable?

Java Programming Language >   Fundamentals of Object-Oriented Programming >   Object-Oriented Paradigm  

Short Question

764


Answer:

The String class is immutable, so that once it is created a String object cannot be changed. Since String is immutable it can safely be shared between many threads ,which is considered very important for multithreaded programming.


This Particular section is dedicated to Question & Answer only. If you want learn more about Java Programming Language. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.