filmov
tv
StringBuffer vs StringBuilder || Java interview question 2021

Показать описание
StringBuffer:
Every method present in StringBuffer is synchronized.
At a time only one thread is allow to operate on the StringBuffer object hence StringBuffer Object is thread safe.
It increases waiting time of the thread and hence relatively performance is low.
Introduced in 1.0 version.
StringBuilder:
Every method present in StringBuilder is non-Synchronized.
At a time multiple threads are allowed to operate simultaneously on the StringBuilder is not thread safe.
Threads are not required to wait hence relatively performance is high.
Introduced in 1.5 version.
#stringbufferjava
#stringbuilderjava
#java
#javainterviewquestion If you want to help us for enlarging our channel, then please donate us by your own wish:
Paytm: 7509058785
Every method present in StringBuffer is synchronized.
At a time only one thread is allow to operate on the StringBuffer object hence StringBuffer Object is thread safe.
It increases waiting time of the thread and hence relatively performance is low.
Introduced in 1.0 version.
StringBuilder:
Every method present in StringBuilder is non-Synchronized.
At a time multiple threads are allowed to operate simultaneously on the StringBuilder is not thread safe.
Threads are not required to wait hence relatively performance is high.
Introduced in 1.5 version.
#stringbufferjava
#stringbuilderjava
#java
#javainterviewquestion If you want to help us for enlarging our channel, then please donate us by your own wish:
Paytm: 7509058785