Secret to Memorize 50 Elements From The Periodic Table.Click Here.

How to remember difference between StringBuilder and StringBuffer?

0 votes
asked Dec 14, 2015 by nanospeck (4,600 points)

How can I remember about thread safety in StringBuilder and StringBuffer without getting confused with each other.




1 Answer

0 votes
answered Dec 14, 2015 by nanospeck (4,600 points)
Here is an easy trick to remember it.

Only StringBuilder has the letter 'i' in it . If you put the letter 'i' upside down, it becomes '!' - equivalent to 'not' symbol in programming languages.

Hence 'StringBuilder' can be related with the word 'not' which can help you remember -> non-synchronized.

Get help in Facebook Messenger!

2 Other people got help thru our messenger bot today!