Re:Java StringBuffer and StringBuilder performance
by shiv86 on Monday June 13, 2016 @03:56PM
(#11896975)
99% of the time you initialize StringBuilder during a method call. Each method call stores it’s variables on the stack and each thread has its own stack.
So in the above 99% usecases StringBuilder is thread safe by default.
Use cases for StringBuffer are very limited …I can’t even think of an example where I would use it.
Use cases for StringBuffer are very limited …I can’t even think of an example where I would use it.