Skip to content

Instantly share code, notes, and snippets.

@gauravkukade
Last active December 23, 2020 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gauravkukade/00bd416bcb2ca1c72dbcd600d48e2f78 to your computer and use it in GitHub Desktop.
Save gauravkukade/00bd416bcb2ca1c72dbcd600d48e2f78 to your computer and use it in GitHub Desktop.
A Java program to convert StringBuilder to String. Read How to convert StringBuilder to String i Java : coderolls.com/convert-stringbuilder-to-string-in-java
/**
* A Java program to convert StringBuilder to String
* @author Gaurav Kukade at cderlls.com
*
*/
public class StringBuilderToString {
public static void main(String[] args) {
StringBuilder stringBuilder = new StringBuilder("Hello ");
stringBuilder.append("Gaurav ")
.append("Kukade!");
System.out.println("Printing strinBuilder as String: \n");
System.out.println(stringBuilder.toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment