What is the difference between StringBuffer and Stringbuilder ?

Ans :- these are the difference  between String Buffer and String Builder

s.NoString BufferString Builder
1.StringBuffer is SynchronizedStringBuilder is non Synchronized
2.StringBuffer  is thread safeStringBuilder is not thread safe
3StringBuffer is less efficient than StringBuilder StringBuilder  is more efficient than StringBuffer 
4.StringBuffer is introduced in java 1.0StringBuilder was introduced in java 1.5

Leave a Reply

Your email address will not be published. Required fields are marked *

*