StringBuffer and StringBuilder in java | Tutorial-43 | latest | 2020

preview_player
Показать описание
String, StringBuffer and StringBuilder :  
StringBuffer and StringBuilder are not immutable classes it means that the objects of StringBuffer and StringBuilder classes can be changed once the value is assigned to be objects. Heap Data Structure is used to store the objects created for StringBuffer and StringBuilder class. StringBuffer and StringBuilder are very much same type classes and has the same set of methods, but each method in StringBuffer is synchronised it means that StringBuffer is thread safe. StringBuilder is not thread safe. Due to thread safety, StringBuffer class also has disadvantage of low performance. StringBuilder class has better performance in comparison to StringBuffer class as it is not thread safe, it means that more than one Threads can access to the object of StringBuilder class. Access and retrieval of StringBuilder class objects is much faster in comparison to StringBuffer and String class objects. StringBuffer is comparatively faster than String. The value of StringBuffer object can be changed, it means that they can be assigned a new value and the capacity of the StringBuffer class object can be dynamically changed at run-time.
Рекомендации по теме
Комментарии
Автор

I liked this video on StringBuilder and StringBuffer classes, thank you for such wonderful tutorial

rupalrastogi
welcome to shbcf.ru