What is the main difference between a String and a StringBuffer class?

The String class is immutable. The StringBuffer class is mutable . String is slow and consumes more memory when we concatenate too many strings because every time it creates new instance. StringBuffer is fast and consumes less memory when we concatenate t strings.

Sizin İçin Seçtik  Reklam Tanıtım için neler yapılabilir?

Leave a Reply

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