Is the immutability of Strings taken into account in the Java implementation of String.format()?

Associate
Joined
20 Jan 2023
Posts
5
Location
India
hi i am new to this forum and i have a question- Strings in Java are immutable, So I've always concatenated them using StringBuilder or StringBuffer. Is the String.format() function as capable as StringBuilder or StringBuffer in this regard? To put it another way, does String.format() handle memory in the same way as StringBuffer or StringBuilder do?
 
Back
Top Bottom