Physics, asked by Mutagekarswapni2793, 1 year ago

Differentiate between StringBuffer and StringBuilder in Java programming.

Answers

Answered by Erka
1

StringBuffer

1) StringBuffer is synchronized i.e. thread safe. It means two threads can't call the methods of StringBuffer simultaneously.

2) StringBuffer is less efficient than StringBuilder.

StringBuilder

1)  StringBuilder is non-synchronized i.e. not thread safe. It means two threads can call the methods of StringBuilder simultaneously.

2) StringBuilder is more efficient than StringBuffer.

HOPE THIS HELPS U


Anonymous: i know u erika
Anonymous: but which class and where u from
Erka: how
Anonymous: ur username is erika so
Erka: i am from usa
Anonymous: classs?
Erka: but i live in inia
Erka: indonasia
Erka: which class are u in
Anonymous: u tell
Similar questions