Good News Students! Become a Spellogram Contributor and Earn Money.Click Here To Know More!

How to remember difference between StringBuilder and StringBuffer?

0 votes
asked Dec 14, 2015 by nanospeck (4,470 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,470 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 ₹100 per Contribution

Submit your Mnemonics to Earn Money Instantly!

*Deadline: 15th August 2017