Why string is not thread safe?



Why string is not thread safe?..

Answer / Anjani Kumar Mishra

"Strings in Java are immutable, meaning once created, they cannot be modified. However, their internal representation can still be shared among multiple threads without proper synchronization, which may lead to inconsistencies and unexpected results."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

describe synchronization in respect to multithreading? : Java thread

1 Answers  


What classes of exceptions, thrown by a throw statement?

2 Answers  


What is the difference between I ++ and ++ I in java?

1 Answers  


What is difference between throw and throws ?

1 Answers   Cyient,


What is the purpose of finalization?

4 Answers  


How can we use primitive data types as objects?

1 Answers  


What is the size of integer?

1 Answers  


What will happen if we declare don’t declare the main as static?

5 Answers  


How do you check if two given string are anagrams?

1 Answers  


What's the purpose of using break in each case of switch statement?

1 Answers  


What is the difference between array and arraylist? what is the difference between arraylist and linkedlist?

8 Answers   EDS, Matrix,


What is HashTable?

4 Answers  


Categories