Why java strings are immutable in nature?



Why java strings are immutable in nature?..

Answer / Ravindera Kumar Dhar Dwidi

Java Strings are immutable because once created, they cannot be changed or modified. This is a design decision made by the creators of Java to ensure thread safety and consistency as String objects cannot be accidentally mutated during their use.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

How are observer and observable used in java programming?

1 Answers  


Which arithmetic operations can result in the throwing of an arithmeticexception?

1 Answers  


Why is java so important?

1 Answers  


What classes can be used to store arbitrary number of objects ?

1 Answers  


What are the legal operands of the instanceof operator?

1 Answers  


Program to output as below formate: 1 2 3 4 5 6 7 8 9 10

4 Answers   Huawei,


What is the relationship between class and object?

1 Answers  


What is difference between overloading and overriding in java?

1 Answers  


What is the difference between jdk, jre, and jvm?

1 Answers  


What are library required to connect to excel sheet.

2 Answers   Cap Gemini,


why doesn't java run on all platforms?

1 Answers  


I am unable to find or learn about print command. I have a graphical program in core java in applet but i want to give print command but i have coding for that so if anyone know about this plz mail me on avdhesh_chauhan007@yahoo.co.in

1 Answers  


Categories