Skip to content

Instantly share code, notes, and snippets.

@adojos
Last active March 9, 2023 11:08
Show Gist options
  • Save adojos/d4c4941262089acf588762a048e0b00d to your computer and use it in GitHub Desktop.
Save adojos/d4c4941262089acf588762a048e0b00d to your computer and use it in GitHub Desktop.
Java: Concatenate Strings Using StringBuffer.append() #java
private static void usingStringBuffer() {
String string1 = "Hello ";
String string2 = "World";
StringBuffer result = new StringBuffer();
result.append(string1);
result.append(string2);
System.out.println(result);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment