How to create a string, where multiple threads will be only reading that string?
Since Strings are immutable (no body can change in the same place). So you can use it with multiple threads, where they can only read.
Both StringBuilder and StringBuffers are mutable(any one can change, which we don't want here).
You can't use character array also, as you can change the data in an array by using indexes of that array.
Back To Top