What is the difference between StringBuffer and Stringbuilder ?
Ans :- these are the difference between String Buffer and String Builder
s.No | String Buffer | String Builder |
1. | StringBuffer is Synchronized | StringBuilder is non Synchronized |
2. | StringBuffer is thread safe | StringBuilder is not thread safe |
3 | StringBuffer is less efficient than StringBuilder | StringBuilder is more efficient than StringBuffer |
4. | StringBuffer is introduced in java 1.0 | StringBuilder was introduced in java 1.5 |
Leave a Reply