Pergunta de entrevista da empresa Morgan Stanley

What's the different with between String.buffer and String.builder

Resposta da entrevista

Sigiloso

17 de ago. de 2016

StringBuffer and StringBuilder have the same methods with one difference and that's of synchronization. StringBuffer is synchronized( which means it is thread safe and hence you can use it when you implement threads for your methods) whereas StringBuilder is not synchronized( which implies it isn't thread safe).

1