Title: StringBuilder Java Example - Java Code Geeks
Open Graph Title: StringBuilder Java Example - Java Code Geeks
Description: In this post, we feature a comprehensive StringBuilder Java Example. StringBuffer in Java is the same as StringBuilder, but the first is thread-safe.
Open Graph Description: In this post, we feature a comprehensive StringBuilder Java Example. StringBuffer in Java is the same as StringBuilder, but the first is thread-safe.
Mail addresses
support@javacodegeeks.com
Opengraph URL: https://examples.javacodegeeks.com/stringbuilder-java-example/
Generator: WordPress 6.9.4
Domain: examples.javacodegeeks.com
{"@context":"https://schema.org","@graph":[{"@type":"Article","@id":"https://examples.javacodegeeks.com/stringbuilder-java-example/#article","isPartOf":{"@id":"https://examples.javacodegeeks.com/stringbuilder-java-example/"},"author":{"name":"Mary Zheng","@id":"https://examples.javacodegeeks.com/#/schema/person/8a2034fbabcb20a9396e9819261855ae"},"headline":"StringBuilder Java Example","datePublished":"2014-04-04T13:10:20+00:00","dateModified":"2020-03-11T14:04:14+00:00","mainEntityOfPage":{"@id":"https://examples.javacodegeeks.com/stringbuilder-java-example/"},"wordCount":711,"commentCount":1,"publisher":{"@id":"https://examples.javacodegeeks.com/#organization"},"image":{"@id":"https://examples.javacodegeeks.com/stringbuilder-java-example/#primaryimage"},"thumbnailUrl":"https://examples.javacodegeeks.com/wp-content/uploads/2012/12/java-logo.jpg","articleSection":["StringBuilder"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https://examples.javacodegeeks.com/stringbuilder-java-example/#respond"]}]},{"@type":"WebPage","@id":"https://examples.javacodegeeks.com/stringbuilder-java-example/","url":"https://examples.javacodegeeks.com/stringbuilder-java-example/","name":"StringBuilder Java Example - Java Code Geeks","isPartOf":{"@id":"https://examples.javacodegeeks.com/#website"},"primaryImageOfPage":{"@id":"https://examples.javacodegeeks.com/stringbuilder-java-example/#primaryimage"},"image":{"@id":"https://examples.javacodegeeks.com/stringbuilder-java-example/#primaryimage"},"thumbnailUrl":"https://examples.javacodegeeks.com/wp-content/uploads/2012/12/java-logo.jpg","datePublished":"2014-04-04T13:10:20+00:00","dateModified":"2020-03-11T14:04:14+00:00","description":"In this post, we feature a comprehensive StringBuilder Java Example. StringBuffer in Java is the same as StringBuilder, but the first is thread-safe.","breadcrumb":{"@id":"https://examples.javacodegeeks.com/stringbuilder-java-example/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https://examples.javacodegeeks.com/stringbuilder-java-example/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https://examples.javacodegeeks.com/stringbuilder-java-example/#primaryimage","url":"https://examples.javacodegeeks.com/wp-content/uploads/2012/12/java-logo.jpg","contentUrl":"https://examples.javacodegeeks.com/wp-content/uploads/2012/12/java-logo.jpg","width":150,"height":150,"caption":"Bipartite Graph"},{"@type":"BreadcrumbList","@id":"https://examples.javacodegeeks.com/stringbuilder-java-example/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://examples.javacodegeeks.com/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https://examples.javacodegeeks.com/category/java-development/"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https://examples.javacodegeeks.com/category/java-development/core-java/"},{"@type":"ListItem","position":4,"name":"lang","item":"https://examples.javacodegeeks.com/category/java-development/core-java/lang/"},{"@type":"ListItem","position":5,"name":"StringBuilder","item":"https://examples.javacodegeeks.com/category/java-development/core-java/lang/stringbuilder/"},{"@type":"ListItem","position":6,"name":"StringBuilder Java Example"}]},{"@type":"WebSite","@id":"https://examples.javacodegeeks.com/#website","url":"https://examples.javacodegeeks.com/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https://examples.javacodegeeks.com/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://examples.javacodegeeks.com/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https://examples.javacodegeeks.com/#organization","name":"Exelixis Media P.C.","url":"https://examples.javacodegeeks.com/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https://examples.javacodegeeks.com/#/schema/logo/image/","url":"https://examples.javacodegeeks.com/wp-content/uploads/2022/06/exelixis-logo.png","contentUrl":"https://examples.javacodegeeks.com/wp-content/uploads/2022/06/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https://examples.javacodegeeks.com/#/schema/logo/image/"},"sameAs":["https://www.facebook.com/javacodegeeks","https://x.com/javacodegeeks"]},{"@type":"Person","@id":"https://examples.javacodegeeks.com/#/schema/person/8a2034fbabcb20a9396e9819261855ae","name":"Mary Zheng","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https://examples.javacodegeeks.com/#/schema/person/image/","url":"https://examples.javacodegeeks.com/wp-content/uploads/2017/11/Mary-Zheng_avatar_1510732235-96x96.jpg","contentUrl":"https://examples.javacodegeeks.com/wp-content/uploads/2017/11/Mary-Zheng_avatar_1510732235-96x96.jpg","caption":"Mary Zheng"},"description":"Mary has graduated from Mechanical Engineering department at ShangHai JiaoTong University. She also holds a Master degree in Computer Science from Webster University. During her studies she has been involved with a large number of projects ranging from programming and software engineering. She works as a senior Software Engineer in the telecommunications sector where she acts as a leader and works with others to design, implement, and monitor the software solution.","url":"https://examples.javacodegeeks.com/author/mary-zheng/"}]}
{"@context":"http:\/\/schema.org","@type":"BreadcrumbList","@id":"#Breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"item":{"name":"Home","@id":"https:\/\/examples.javacodegeeks.com\/"}},{"@type":"ListItem","position":2,"item":{"name":"Java Development","@id":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"}},{"@type":"ListItem","position":3,"item":{"name":"Core Java","@id":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/"}},{"@type":"ListItem","position":4,"item":{"name":"lang","@id":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/lang\/"}},{"@type":"ListItem","position":5,"item":{"name":"StringBuilder","@id":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/lang\/stringbuilder\/"}}]}
{"@context":"http:\/\/schema.org","@type":"Article","dateCreated":"2014-04-04T16:10:20+03:00","datePublished":"2014-04-04T16:10:20+03:00","dateModified":"2020-03-11T16:04:14+02:00","headline":"StringBuilder Java Example","name":"StringBuilder Java Example","keywords":[],"url":"https:\/\/examples.javacodegeeks.com\/stringbuilder-java-example\/","description":"In this post, we feature a comprehensive StringBuilder Java Example. StringBuffer in Java is the same as StringBuilder, but the first is thread-safe. At the end of this article, we will create an abst","copyrightYear":"2014","articleSection":"StringBuilder","articleBody":"\nIn this post, we feature a comprehensive StringBuilder Java Example. StringBuffer in Java is the same as StringBuilder, but the first is thread-safe. At the end of this article, we will create an abstract TestBase class which shows StringBuffer 's common methods.\n\n\n\n1. Introduction\n\n\n\nStringBuilder object seems like a String object but with the characteristics of an array. Every object of this type is like a sequence of characters that can be modified. The StringBuilder class provides many methods for changing the content and\/or the length of the sequence, for initializing the capacity etc. StringBuilder class is mostly used when we want to concatenate many strings continuously and\/or treat them like variable-length arrays.\n\n\n\n\n\n\n\nIn this example, as you can expect, we are going to show how to use basic operations of\u00a0StringBuilder\u00a0class.\n\n\n\nFour constructors of StringBuilderStringBuilder common methods: append, delete, and insertThe comparison between StringBuilder and String\n\n\n\n2. Technologies Used\n\n\n\nThe example code in this article was built and run using:\n\n\n\nJava 11Maven 3.3.9Eclipse OxygenJunit 4.12\n\n\n\n3. Maven Project\n\n\n\n3.1 Dependencies\n\n\n\nI will include Junit in the pom.xml.\n\n\n\npom.xml\n\n\n\n\n<project xmlns=\"http:\/\/maven.apache.org\/POM\/4.0.0\"\n\txmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\n\txsi:schemaLocation=\"http:\/\/maven.apache.org\/POM\/4.0.0 http:\/\/maven.apache.org\/xsd\/maven-4.0.0.xsd\">\n\t<modelVersion>4.0.0<\/modelVersion>\n\t<groupId>jcg.zheng.demo<\/groupId>\n\t<artifactId>java-strringbuilder-demo<\/artifactId>\n\t<version>0.0.1-SNAPSHOT<\/version>\n\t<build>\n\t\t<sourceDirectory>src<\/sourceDirectory>\n\t\t<plugins>\n\t\t\t<plugin>\n\t\t\t\t<artifactId>maven-compiler-plugin<\/artifactId>\n\t\t\t\t<version>3.8.0<\/version>\n\t\t\t\t<configuration>\n\t\t\t\t\t<release>11<\/release>\n\t\t\t\t<\/configuration>\n\t\t\t<\/plugin>\n\t\t<\/plugins>\n\t<\/build>\n\t<dependencies>\n\t\t<dependency>\n\t\t\t<groupId>junit<\/groupId>\n\t\t\t<artifactId>junit<\/artifactId>\n\t\t\t<version>4.12<\/version>\n\t\t<\/dependency>\n\t<\/dependencies>\n<\/project>\n\n\n\n3.2 Read File Application\n\n\n\nIn this step, I will create a FeadFileApp class which reads all the lines of a file and append them into a string builder, separated by \u2018@\u2019 character, until the end of the file. Finally, it calls toString() method in order to take the string representation of the string builder. In conclusion, I use it to show that StringBuilder class offers a better performance.\n\n\n\nReadFileApp.java\n\n\n\n\npackage jcg.zheng.demo;\n\nimport java.io.BufferedReader;\nimport java.io.FileNotFoundException;\nimport java.io.FileReader;\nimport java.io.IOException;\n\npublic class ReadFileApp {\n\tpublic static void main(String[] args) {\n\t\tString fileName = \"C:\/MaryZheng\/jcgFile.txt\";\n\t\ttry {\n\t\t\tBufferedReader br = new BufferedReader(new FileReader(fileName));\n\t\t\tStringBuilder sbFile = new StringBuilder();\n\t\t\tString line = br.readLine();\n\n\t\t\twhile (line != null) {\n\t\t\t\tsbFile.append(line);\n\t\t\t\tsbFile.append('@');\n\n\t\t\t\tline = br.readLine();\n\t\t\t}\n\n\t\t\tString readFile = sbFile.toString();\n\t\t\tbr.close();\n\t\t\tSystem.out.println(\"from file: \" + readFile);\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}\n}\n\n\n\n\nOutput of the Java application\n\n\n\nfrom file: Hello@How are you@\n\n\n\n3.3 POJO Example\n\n\n\nIn this step, I will create a POJOExample class which is used to append an object argument to a StringBuilder object.\n\n\n\nPOJOExample.java\n\n\n\n\npackage jcg.zheng.demo;\n\npublic class POJOExample {\n\n\tpublic POJOExample(String name, int id) {\n\t\tsuper();\n\t\tthis.name = name;\n\t\tthis.id = id;\n\t}\n\n\tprivate String name;\n\tprivate int id;\n\n\t@Override\n\tpublic String toString() {\n\t\treturn \"POJOExample [name=\" + name + \", id=\" + id + \"]\";\n\t}\n\n}\n\n\n\n\n4. JUnit Test\n\n\n\n4.1 TestBase\n\n\n\nAs we stated at the beginning of the article, StringBuffer in Java is the same as StringBuilder, but the first is thread-safe. In this step, I will create an abstract TestBase class which shows StringBuffer 's common methods:\n\n\n\nappend - adds a specified parameter to a string builder. In this step, I create test methods for various data types: boolean, char, char[], double, POJOExample, String, and StringBuilder.insert - inserts the string representation of a data type in a specific offset of the sequence.delete - removes a specific portion of the string builder.length - returns the current number of characters in the string builder sequence.capacity - returns the current capacity which indicates the allocation of character space of the string builder.\n\n\n\nA StringBuilder object will be created in a separated test class which extends from TestBase.\n\n\n\nTestBase.java\n\n\n\n\npackage jcg.zheng.demo;\n\nimport static org.junit.Assert.assertEquals;\n\nimport org.junit.Test;\n\npublic abstract class TestBase {\n\n\tprivate static final String HELLO_EVERYONE_FROM_JCG = \"Hello Everyone from JCG\";\n\tprivate static final String EVERYONE = \"Everyone \";\n\tprivate static final String HELLO_FROM_JCG = \"Hello from JCG\";\n\tprotected StringBuilder sb;\n\n\tpublic TestBase() {\n\t\tsuper();\n\t}\n\n\tprotected void clear() {\n\t\tif (sb.length() >= 1) {\n\t\t\tsb.delete(0, sb.length());\n\t\t\tassertEquals(0, sb.length());\n\t\t}\n\t}\n\t\n\t@Test\n\tpublic void test_append_boolean() {\n\t\tsb.append(true);\n\t\tsb.append(false);\n\t\tassertEquals(\"truefalse\", sb.toString());\n\t}\n\n\t@Test\n\tpublic void test_append_char() {\n\t\tsb.append('|');\n\t\tassertEquals(\"|\", sb.toString());\n\t}\n\t\n\t@Test\n\tpublic void test_append_charArray() {\n\t\tchar[] abc = {'a', 'b', 'c'};\n\t\tsb.append(abc);\n\t\tassertEquals(\"abc\", sb.toString());\n\t}\n\t\n\t@Test\n\tpublic void test_append_double() {\n\t\tsb.append(123.456);\n\t\tassertEquals(\"123.456\", sb.toString());\n\t}\n\t\n\t@Test\n\tpublic void test_append_object() {\n\t\tsb.append(new POJOExample(\"Mary\", 1));\n\t\tassertEquals(\"POJOExample [name=Mary, id=1]\", sb.toString());\n\t}\n\n\t@Test\n\tpublic void test_append_string() {\n\t\tsb.append(HELLO_FROM_JCG);\n\t\tassertEquals(HELLO_FROM_JCG, sb.toString());\n\t}\n\t\n\t@Test\n\tpublic void test_append_anotherSB() {\n\t\tStringBuilder sb2 = new StringBuilder(\"New Value\");\n\t\tsb.append(sb2);\n\t\tassertEquals(\"New Value\", sb.toString());\n\t}\n\n\t@Test\n\tpublic void test_delete() {\n\t\tsb.append(HELLO_FROM_JCG);\n\t\tsb.delete(6, 11);\n\t\tassertEquals(\"Hello JCG\", sb.toString());\n\t}\n\n\t@Test\n\tpublic void test_insert() {\n\t\tsb.append(HELLO_FROM_JCG);\n\t\tsb.insert(6, EVERYONE);\n\t\tassertEquals(HELLO_EVERYONE_FROM_JCG, sb.toString());\n\t}\n\n}\n\n\n\n4.2 Default Constructor\n\n\n\nIn this step, I will create a ConstructorStingBuilder1Test which extends from TestBase and creates a StringBuilder object from the default constructor. The created object has a default capacity of 16 which means 16 empty characters.\n\n\n\nConstructStringBuilder1Test.java\n\n\n\n\npackage jcg.zheng.demo;\n\nimport static org.junit.Assert.assertEquals;\n\nimport org.junit.Before;\n\npublic class ConstructStringBuilder1Test extends TestBase {\n\n\t@Before\n\tpublic void setup() {\n\t\tsb = new StringBuilder();\n\t\tassertEquals(16, sb.capacity());\n\t\tassertEquals(0, sb.length());\n\t\tclear();\n\t}\n\n}\n\n\n\nOutput of mvn test -Dtest=ConstructStringBuilder1Test\n\n\n\n-------------------------------------------------------\n T E S T S\n-------------------------------------------------------\nRunning jcg.zheng.demo.ConstructStringBuilder1Test\nTests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.168 sec\n\nResults :\n\nTests run: 9, Failures: 0, Errors: 0, Skipped: 0\n\n\n\n4.3 Constructor with Capacity\n\n\n\nIn this step, I will create a ConstructorStingBuilder2Test which extends from TestBase and creates a StringBuilder object with a capacity number. Here is the capacity constructor signature:\n\n\n\n\/*Constructs a string builder with no characters in it and an initial capacity specified by the capacity argument.\ncapacity - the initial capacity.*\/\nStringBuilder\u200b(int capacity)\n\n\n\nConstructStringBuilder2Test.java\n\n\n\n\npackage jcg.zheng.demo;\n\nimport static org.junit.Assert.assertEquals;\n\nimport org.junit.Before;\n\npublic class ConstructStringBuilder2Test extends TestBase {\n\n\t@Before\n\tpublic void setup() {\n\t\t\/\/ initialized capacity\n\t\tsb = new StringBuilder(15);\n\t\tassertEquals(15, sb.capacity());\n\t\tassertEquals(0, sb.length());\n\t\tclear();\n\t}\n\n}\n\n\n\nOutput of mvn test -Dtest=ConstructStringBuilder2Test\n\n\n\n\n-------------------------------------------------------\n T E S T S\n-------------------------------------------------------\nRunning jcg.zheng.demo.ConstructStringBuilder2Test\nTests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.162 sec\n\nResults :\n\nTests run: 9, Failures: 0, Errors: 0, Skipped: 0\n\n\n\n4.4 Constructor with CharSequence\n\n\n\nIn this step, I will create a ConstructorStingBuilder3Test which extends from TestBase and creates a StringBuilder object from a CharSequence. Here is the CharSequence constructor signature:\n\n\n\n\/*Constructs a string builder that contains the same characters as the specified CharSequence. The initial capacity of the string builder is 16 plus the length of the CharSequence argument.\nseq - the sequence to copy.*\/\nStringBuilder\u200b(CharSequence seq)\n\n\n\nThe created object has a capacity of 72. \n\n\n\nConstructStringBuilder3Test.java\n\n\n\n\npackage jcg.zheng.demo;\n\nimport static org.junit.Assert.assertEquals;\n\nimport org.junit.Before;\n\npublic class ConstructStringBuilder3Test extends TestBase {\n\n @Before\n public void setup() {\n \/\/ initialized capacity\n sb = new StringBuilder('H');\n assertEquals(72, sb.capacity());\n assertEquals(0, sb.length());\n clear();\n }\n\n}\n\n\n\nOutput of mvn test -Dtest=ConstructStringBuilder3Test\n\n\n\n\n-------------------------------------------------------\n T E S T S\n-------------------------------------------------------\nRunning jcg.zheng.demo.ConstructStringBuilder3Test\nTests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.211 sec\n\nResults :\n\nTests run: 9, Failures: 0, Errors: 0, Skipped: 0\n\n\n\n\n4.5 Constructor with String\n\n\n\nIn this step, I will create a ConstructorStingBuilder4Test which extends from TestBase and creates a StringBuilder object from a String object. Here is the string constructor signature: \n\n\n\n\/*Constructs a string builder initialized to the contents of the specified string.\nstr - the initial contents of the buffer.*\/\nStringBuilder\u200b(String str)\n\n\n\nThe created object has a capacity of 21. \n\n\n\nConstructStringBuilder4Test.java\n\n\n\n\npackage jcg.zheng.demo;\n\nimport static org.junit.Assert.assertEquals;\n\nimport org.junit.Before;\n\npublic class ConstructStringBuilder4Test extends TestBase {\n\n\t@Before\n\tpublic void setup() {\n\t\t\/\/ initialized capacity\n\t\tsb = new StringBuilder(\"Hello\");\n\t\tassertEquals(21, sb.capacity());\n\t\tassertEquals(5, sb.length());\n\t\tclear();\n\t}\n\n}\n\n\n\nOutput of mvn test -Dtest=ConstructStringBuilder4Test\n\n\n\n\n-------------------------------------------------------\n T E S T S\n-------------------------------------------------------\nRunning jcg.zheng.demo.ConstructStringBuilder4Test\nTests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.165 sec\n\nResults :\n\nTests run: 9, Failures: 0, Errors: 0, Skipped: 0\n\n\n\n4.6 Comparison with String\n\n\n\nIn this step, I will create a StingBuilder_StringTest which demonstrates that StringBuilder is mutable and String is immutable.\n\n\n\ntestString - it creates a msg String variable and uses + to append a string. You can confirm that each + operation return a new String object by viewing the msg's ID at debugging.testStringBuilder - it changes the StringBuilder object - msg - by using append method.\n\n\n\nStringBuilder_StringTest.java\n\n\n\n\npackage jcg.zheng.demo;\n\nimport static org.junit.Assert.assertEquals;\n\nimport org.junit.Test;\n\npublic class StringBuilder_StringTest {\n\n\t@Test\n\tpublic void testString() {\n\t\tString msg = \"Hello\";\n\t\tmsg = msg + \" JCG\";\n\t\tmsg = msg + \" World\";\n\t\tassertEquals(\"Hello JCG World\", msg);\n\t}\n\n\t@Test\n\tpublic void testStringBuilder() {\n\t\tStringBuilder msg = new StringBuilder();\n\t\tmsg.append(\"Hello\");\n\t\tmsg.append(\" JCG\");\n\t\tmsg.append(\" World\");\n\n\t\tassertEquals(\"Hello JCG World\", msg.toString());\n\t}\n\n}\n\n\n\n\nOutput of mvn test -DTest=StringBuilder_StringTest\n\n\n\n\n-------------------------------------------------------\n T E S T S\n-------------------------------------------------------\nRunning jcg.zheng.demo.StringBuilder_StringTest\nTests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.14 sec\n\nResults :\n\nTests run: 2, Failures: 0, Errors: 0, Skipped: 0\n\n\n\n5. StringBuilder Java Example - Summary\n\n\n\nIn this example, I demonstrated what the\u00a0StringBuilder\u00a0class offers in order to have better performance. We showed its four constructors and several of StringBuffer 's common methods in Java, like: append, delete, insert, etc which change the content.\n\n\n\n6. Download the Source Code\n\n\n\nThis example consists of a Maven project which contains several Junit tests to demonstrate the usage of the StringBuilder class.\n\n\n\nDownload\nYou can download the full source code of this example here: StringBuilder Java Example\n\n\n\nLast updated on Jan. 22nd, 2020\n","publisher":{"@id":"#Publisher","@type":"Organization","name":"Examples Java Code Geeks","logo":{"@type":"ImageObject","url":"\/wp-content\/uploads\/2013\/05\/JavaCodeGeeks-logo.png"},"sameAs":["https:\/\/feeds.feedburner.com\/examplesjavacodegeeks","https:\/\/www.facebook.com\/javacodegeeks","https:\/\/twitter.com\/javacodegeeks","https:\/\/www.linkedin.com\/groups\/3810709\/","https:\/\/www.youtube.com\/channel\/UCxoUc7Rar2q90Gu0nT2ffuQ","https:\/\/github.com\/javacodegeeks\/"]},"sourceOrganization":{"@id":"#Publisher"},"copyrightHolder":{"@id":"#Publisher"},"mainEntityOfPage":{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/stringbuilder-java-example\/","breadcrumb":{"@id":"#Breadcrumb"}},"author":{"@type":"Person","name":"Mary Zheng","url":"https:\/\/examples.javacodegeeks.com\/author\/mary-zheng\/"},"image":{"@type":"ImageObject","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","width":1200,"height":150}}
| og:locale | en_US |
| og:type | article |
| og:site_name | Examples Java Code Geeks |
| article:publisher | https://www.facebook.com/javacodegeeks |
| article:published_time | 2014-04-04T13:10:20+00:00 |
| article:modified_time | 2020-03-11T14:04:14+00:00 |
| og:image | https://examples.javacodegeeks.com/wp-content/uploads/2012/12/java-logo.jpg |
| og:image:width | 150 |
| og:image:height | 150 |
| og:image:type | image/jpeg |
| author | Mary Zheng |
| twitter:card | summary_large_image |
| twitter:creator | @javacodegeeks |
| twitter:label1 | Written by |
| twitter:data1 | Mary Zheng |
| twitter:label2 | Est. reading time |
| twitter:data2 | 8 minutes |
| None | IE=edge |
| msapplication-TileImage | https://examples.javacodegeeks.com/wp-content/uploads/2013/05/JavaCodeGeeks-favIcon.png |
Links:
Viewport: width=device-width, initial-scale=1.0
Robots: index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1