Skip to content

Instantly share code, notes, and snippets.

@anishLearnsToCode
Created August 1, 2020 16:58
Show Gist options
  • Save anishLearnsToCode/8d521d4016747dc81e0f654a7e07be7a to your computer and use it in GitHub Desktop.
Save anishLearnsToCode/8d521d4016747dc81e0f654a7e07be7a to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class StringBuilderExample {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
StringBuilder builder = new StringBuilder(scanner.nextLine());
builder.append(" hello world");
System.out.println(builder.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment