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
123 views
asked Dec 14, 2015 by nanospeck (4,390 points)

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

 

StringBufferStringBuilder
SynchronizedNon-Synchronized

 

1 Answer

0 votes
answered Dec 14, 2015 by nanospeck (4,390 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.

"StringBu!lder"
Do you have Mnemonics?

Submit your Mnemonics to Win Cash Prizes!


*Deadline: 15th March 2017
...