๐ŸŒ
Oracle
docs.oracle.com โ€บ javase โ€บ 8 โ€บ docs โ€บ api โ€บ java โ€บ lang โ€บ StringBuilder.html
StringBuilder (Java Platform SE 8 )
April 21, 2026 - Where possible, it is recommended that this class be used in preference to StringBuffer as it will be faster under most implementations. The principal operations on a StringBuilder are the append and insert methods, which are overloaded so as to accept data of any type.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ stringbuilder-append-method-in-java-with-examples
StringBuilder append() Method in Java - GeeksforGeeks
July 11, 2025 - In Java, the append() method of StringBuilder class is used to add data to the end of an existing StringBuilder object.
Discussions

how the append method of StringBuilder in Java works, and why the string passed to it as a parameter doesn't create a new string object in memory - Stack Overflow
At runtime a StringBuilder is initialized with "mainWord". At this time the reference is passed, and Java is smart enough to not copy the whole String. When calling append with the other string, again a reference is passed. But now StringBuilder realizes it needs to copy both the data. More on stackoverflow.com
๐ŸŒ stackoverflow.com
Implementing append method of stringbuilder class
The Java source code is publicly available. Check it. More on reddit.com
๐ŸŒ r/learnjava
7
4
December 28, 2024
Java StringBuilder append methods chain - Stack Overflow
equivalent, but they will differ in speed and how JVM recognizes this code. stackoverflow.com/questions/44334233/โ€ฆ 2017-11-23T14:12:04.65Z+00:00 ... Save this answer. ... Show activity on this post. append() on StringBuilder just returns this as a convenience. More on stackoverflow.com
๐ŸŒ stackoverflow.com
java - Appending a StringBuilder to another StringBuilder - Stack Overflow
Interestingly there is an append(StringBuffer sb). ... Why have a append(StringBuffer sb) method and not a append(StringBuilder sb) method? More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Medium
medium.com โ€บ @AlexanderObregon โ€บ javas-stringbuilder-append-method-explained-500b2ef84ec0
Javaโ€™s StringBuilder.append() Method Explained | Medium
August 6, 2024 - Using the StringBuilder.append() method offers significant performance advantages over traditional string concatenation using the + operator. Understanding these benefits can help you make more efficient choices in your code, especially in scenarios involving extensive string manipulation. In Java, strings are immutable, meaning that once a String object is created, it cannot be modified.
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ java โ€บ stringbuilder โ€บ .append()
Java | StringBuilder | .append() | Codecademy
August 22, 2022 - The .append() method appends the string value of its argument to the StringBuilder. It returns a reference to the StringBuilder object. ... Looking for an introduction to the theory behind programming?
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ java โ€บ lang โ€บ stringbuilder_append_string.htm
Java.lang.StringBuilder.append() Method
The java.lang.StringBuilder.append(String str) method appends the specified string to this character sequence.The characters of the String argument are appended, in order, increasing the length of this sequence by the length of the argument.
๐ŸŒ
CodeGym
codegym.cc โ€บ java blog โ€บ strings in java โ€บ append() method in java: stringbuilder and stringbuffer
Append() Method in Java: StringBuilder and StringBuffer
September 28, 2023 - append() is a Java method of StringBuilder and StringBuffer classes that appends some value to a current sequence. Even if you didn't know what the append() method is, you probably already used it implicitly.
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ dotnet โ€บ api โ€บ java.lang.stringbuilder.append
StringBuilder.Append Method (Java.Lang) | Microsoft Learn
Appends the string representation of the specified float value. [Android.Runtime.Register("append", "(F)Ljava/lang/StringBuilder;", "")] public Java.Lang.IAppendable Append(float f); [<Android.Runtime.Register("append", "(F)Ljava/lang/Strin...
Find elsewhere
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ stringbuilder-class-in-java-with-examples
StringBuilder Class in Java - GeeksforGeeks
The append() method adds the given string to the end of the existing sequence without creating a new object. This makes StringBuilder efficient for concatenation operations.
Published ย  May 8, 2026
๐ŸŒ
Oracle
docs.oracle.com โ€บ javase โ€บ 7 โ€บ docs โ€บ api โ€บ java โ€บ lang โ€บ StringBuilder.html
StringBuilder (Java Platform SE 7 )
Where possible, it is recommended that this class be used in preference to StringBuffer as it will be faster under most implementations. The principal operations on a StringBuilder are the append and insert methods, which are overloaded so as to accept data of any type.
๐ŸŒ
BeginnersBook
beginnersbook.com โ€บ 2014 โ€บ 08 โ€บ java-stringbuilder-append-char-c-method
Java โ€“ StringBuilder.append(char c) Method
October 6, 2022 - public class JavaExample { public static void main(String[] args) { StringBuilder sb = new StringBuilder("BeginnersBook"); System.out.println("Sequence :"+sb); char[] chArray = {'a','b','c','.','c','o','m'}; // appending elements of char array from 4th till 7th sb.append(chArray, 3, 4); System.out.println("New Sequence: " + sb); } }
๐ŸŒ
Oracle
docs.oracle.com โ€บ javase โ€บ 6 โ€บ docs โ€บ api โ€บ java โ€บ lang โ€บ StringBuilder.html
StringBuilder (Java Platform SE 6)
Where possible, it is recommended that this class be used in preference to StringBuffer as it will be faster under most implementations. The principal operations on a StringBuilder are the append and insert methods, which are overloaded so as to accept data of any type.
๐ŸŒ
Reddit
reddit.com โ€บ r/learnjava โ€บ implementing append method of stringbuilder class
Implementing append method of stringbuilder class : r/learnjava
December 28, 2024 - copy characters from another StringBuilder (actually a char array) at the end of the current one. This is handled by getChars, see this. Here, amortized allocation is done by multiplying the current length by 2. But you have to take into account the length of the char array you are appending, that's why expandCapacity.
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ java โ€บ lang โ€บ stringbuilder_append.htm
Java StringBuilder append() Method
The Java StringBuilder append() method appends the string representation of its various arguments to the sequence. This method is a part of the String concatenation technique to combine two or more strings in java.
๐ŸŒ
Baeldung
baeldung.com โ€บ home โ€บ java โ€บ java string โ€บ how to append a newline to a stringbuilder
How to Append a Newline to a StringBuilder | Baeldung
September 25, 2024 - StringBuilder sb = new StringBuilder(); sb.append("Line 1"); sb.append("\n"); sb.append("Line 2"); If we hard-code a newline with โ€œ\nโ€, it may display as expected on the Unix operating system but not on Windows, which expects CRLF (โ€œ\r\nโ€). ...
๐ŸŒ
Reddit
reddit.com โ€บ r/javahelp โ€บ question about stringbuilder
r/javahelp on Reddit: Question about StringBuilder
June 22, 2024 -

So I get that StringBuilders are more efficient than concatenating strings with the "+" operator, because they are manipulating the underlying char[] array. But here's what I don't understand.

Let's look at case 1, where we are appending a string to the StringBuilder inside the parentheses. Doesn't this mean that for every time we call this statement, a new string has to be created and then appended to the StringBuilder?

StringBuilder().append("my new string"); // "my new string" needs to be created every time!

Now let's look at case 2, where we create a premade string, and then we append it to the StringBuilder. Wouldn't this be more efficient, because we can loop through the append statement as many times as we want without creating a new String?

String myString = "hello world";

StringBuilder.append(myString); // myString is already created!

Hope this makes sense. Asking because I'm writing a program that will potentially need to do this same operation millions of times per day, and want to get a better understanding.