{"id":605,"date":"2019-09-03T14:01:07","date_gmt":"2019-09-03T08:16:07","guid":{"rendered":"https:\/\/bcisnotes.com\/secondsemester\/?p=605"},"modified":"2020-05-05T11:35:10","modified_gmt":"2020-05-05T05:50:10","slug":"string-buffer","status":"publish","type":"post","link":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/","title":{"rendered":"String Buffer || Java Collections And Java API Library || Bcis Notes"},"content":{"rendered":"<h2>String Buffer<\/h2>\n<h3>String Buffer<\/h3>\n<p>The String Buffer class is used to create a mutable string. It is same as String class except it is mutable and thread-safe.<\/p>\n<h3>String<\/h3>\n<p>A string is a data type used in programmings, such as an integer and floating-point unit, but is used to represent text rather than numbers. It is comprised of a set of characters that can also contain spaces and numbers.<\/p>\n<p><strong>Java Swing<\/strong><\/p>\n<p>In Java, string is basically an object that represents sequence of char values. An array of characters works same as Java string.<\/p>\n<p>char[] ch={&#8216;j&#8217;,&#8217;a&#8217;,&#8217;v&#8217;,&#8217;a&#8217;,&#8217;p&#8217;,&#8217;o&#8217;,&#8217;i&#8217;,&#8217;n&#8217;,&#8217;t&#8217;};<br \/>\nString\u00a0s=new\u00a0String(ch);<\/p>\n<p><strong>is same as:<\/strong><\/p>\n<p>String s=&#8221;javapoint&#8221;;<\/p>\n<p><strong>creating string<\/strong><\/p>\n<p>In java, a string is an immutable object which means it is constant and cannot be changed once it has been created. There are two ways to create a string in Java:<\/p>\n<p><strong>String literal string s<\/strong> = \u201cGeeksforGeeks\u201d;<br \/>\n<strong>Using new keyword string s<\/strong> = new String (\u201cGeeksforGeeks\u201d);<\/p>\n<p><strong>Examples of string<\/strong><\/p>\n<p>public class Example{<br \/>\npublic static void main(String args[]){<br \/>\n\/\/creating a string by java string literal<br \/>\nString str = &#8220;Beginnersbook&#8221;;<br \/>\nchar arrch[]={&#8216;h&#8217;,&#8217;e&#8217;,&#8217;l&#8217;,&#8217;l&#8217;,&#8217;o&#8217;};<br \/>\n\/\/converting char array arrch[] to string str2<br \/>\nString str2 = new String(arrch);<\/p>\n<p>\/\/creating another java string str3 by using new keyword<br \/>\nString str3 = new String(&#8220;Java String Example&#8221;);<\/p>\n<p>\/\/Displaying all the three strings<br \/>\nSystem.out.println(str);<br \/>\nSystem.out.println(str2);<br \/>\nSystem.out.println(str3);<br \/>\n}<br \/>\n}<\/p>\n<p><strong>String Handling<\/strong><\/p>\n<p>The basic aim of the <strong>String Handling<\/strong> concept is storing the string data in the main memory (RAM), manipulating the data of the String, retrieving the part of the String, etc. <strong>String Handling<\/strong> provides a lot of concepts that can be performed on a string such as concatenation of string, comparison of string, find the substring, etc.<\/p>\n<p><strong>String<\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1013 size-full\" src=\"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/stringbuffer-java.png\" alt=\"String Buffer || Java Collections And Java API Library || Bcis Notes\" width=\"559\" height=\"397\" srcset=\"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/stringbuffer-java.png 559w, https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/stringbuffer-java-300x213.png 300w\" sizes=\"(max-width: 559px) 100vw, 559px\" \/><\/p>\n<p><strong>Concatenating String<\/strong><\/p>\n<p>In java, String concatenation is implemented through the StringBuilder (or StringBuffer) class and its append method. String concatenation operator produces a new string by appending the second operand onto the end of the first operand.<\/p>\n<p>There are 2 methods to concatenate two or more string.<br \/>\n<strong>&#8211; Using Concat() method<\/strong><br \/>\n<strong>\u00a0&#8211; Using + operator<\/strong><br \/>\n<strong>1) Using concat() method<\/strong><br \/>\nstring s = &#8220;Hello&#8221;;<br \/>\nstring str = &#8220;Java&#8221;;<br \/>\nstring str2 = s.concat(str);<br \/>\nString str1 = &#8220;Hello&#8221;.concat(&#8220;Java&#8221;); \/\/works with string literals too.<br \/>\n<strong>2) Using + operator<\/strong><br \/>\nstring str = &#8220;Rahul&#8221;;<br \/>\nstring str1 = &#8220;Dravid&#8221;;<br \/>\nstring str2 = str + str1;<br \/>\nstring st = &#8220;Rahul&#8221;+&#8221;Dravid&#8221;;<\/p>\n<p><strong>String Comparison<\/strong><\/p>\n<p>String comparison can be done in 3 ways.<br \/>\n<strong>\u00a0&#8211; Using equals() method<\/strong><br \/>\n<strong>\u00a0&#8211; Using == operator<\/strong><br \/>\n<strong>\u00a0&#8211; By CompareTo() method<\/strong><br \/>\n<strong>Using equals() method<\/strong><br \/>\nequals() method compares two strings for equality. Its general syntax is,<br \/>\nboolean equals (Object str)It compares the content of the strings. It will return true if string matches, else return false.<br \/>\nString s = &#8220;Hell&#8221;; String s1 = &#8220;Hello&#8221;; String s2 = &#8220;Hello&#8221;; s1.equals(s2); \/\/true s.equals(s1) ; \/\/false<\/p>\n<p><strong>Using == operator<\/strong><br \/>\n==\u00a0operator compares two object references to check whether they refer to same instance. This also, will return\u00a0true\u00a0on successful match.<br \/>\nString s1 = &#8220;Java&#8221;;<br \/>\nString s2 = &#8220;Java&#8221;;<br \/>\nString s3 = new string (&#8220;Java&#8221;);<br \/>\ntest(s1 == s2) \/\/true<br \/>\ntest(s1 == s3) \/\/false<\/p>\n<p><strong>By compareTo() method<\/strong><br \/>\nint compareTo(String str)String s1 = &#8220;Abhi&#8221;;<br \/>\nString s2 = &#8220;Viraaj&#8221;;<br \/>\nString s3 = &#8220;Abhi&#8221;;<br \/>\ns1.compareTo(S2); \/\/return -1 because s1 &lt; s2<br \/>\ns1.compareTo(S3); \/\/return 0 because s1 == s3<br \/>\ns2.compareTo(s1); \/\/return 1 because s2 &gt; s1<\/p>\n<p><strong>Substring()<\/strong><\/p>\n<p>Method\u00a0substring()\u00a0is used for getting a substring of a particular String.<\/p>\n<p>public class SubStringExample{<br \/>\npublic static void main(String args[]) {<br \/>\nString str= new String(&#8220;quick brown fox jumps over the lazy dog&#8221;);<br \/>\nSystem.out.println(&#8220;Substring starting from index 15:&#8221;);<br \/>\nSystem.out.println(str.substring(15));<br \/>\nSystem.out.println(&#8220;Substring starting from index 15 and ending at 20:&#8221;);<br \/>\nSystem.out.println(str.substring(15, 20));<br \/>\n}<br \/>\n}<\/p>\n<p><strong>Output<br \/>\n<\/strong>Substring starting from index 15:<br \/>\njumps over the lazy dog<br \/>\nSubstring starting from index 15 and ending at 20:<br \/>\njump<\/p>\n<p><b>Replace()<\/b><\/p>\n<p>public class Example1{<br \/>\npublic static void main(String args[]){<br \/>\nString str = new String(&#8220;Site is BeginnersBook.com&#8221;);<\/p>\n<p>System.out.print(&#8220;String after replacing all &#8216;o&#8217; with &#8216;p&#8217; :&#8221; );<br \/>\nSystem.out.println(str.replace(&#8216;o&#8217;, &#8216;p&#8217;));<\/p>\n<p>System.out.print(&#8220;String after replacing all &#8216;i&#8217; with &#8216;K&#8217; :&#8221; );<br \/>\nSystem.out.println(str.replace(&#8216;i&#8217;, &#8216;K&#8217;));<br \/>\n}<br \/>\n}<\/p>\n<p><strong>Output<br \/>\n<\/strong>A String after replacing all &#8216;o&#8217; with &#8216;p&#8217; :Site is BeginnersBppk.cpm<br \/>\nA String after replacing all &#8216;<span style=\"color: #800000;\">i<\/span>&#8216; with &#8216;K&#8217; :SKte Ks BegKnnersBook.com<\/p>\n<p><b>ReplaceFirst<\/b><b>()<\/b><\/p>\n<p>public class Example2{<br \/>\npublic static void main(String args[]){<br \/>\nString str = new String(&#8220;Bcis Notes.com&#8221;);<\/p>\n<p>System.out.print(&#8220;String after replacing com with net :&#8221; );<br \/>\nSystem.out.println(str.replaceFirst(&#8220;com&#8221;, &#8220;net&#8221;));<\/p>\n<p>System.out.print(&#8220;String after replacing Site name:&#8221; );<br \/>\nSystem.out.println(str.replaceFirst(&#8220;Bcis Notes(.*)&#8221;, &#8220;XYZ.com&#8221;));<br \/>\n}<br \/>\n}<\/p>\n<p><strong>Output<br \/>\n<\/strong>String after replacing com with net :Site is Bcis Notes.com<br \/>\nString after replacing Site name:Site is XYZ.com<\/p>\n<p>public class Example3{<br \/>\npublic static void main(String args[]){<br \/>\nString str = new String(&#8220;My .com site is Bcis Notes.com&#8221;);<br \/>\nSystem.out.print(&#8220;String after replacing all com with net :&#8221; );<br \/>\nSystem.out.println(str.replaceAll(&#8220;com&#8221;, &#8220;net&#8221;));<br \/>\n}<br \/>\n}<\/p>\n<p><strong>Output<br \/>\n<\/strong>String after replacing all com with net :<strong>My .net site is Bcis Notes.net<\/strong><\/p>\n<p><b>indexOf<\/b><b>()<\/b><\/p>\n<p>This method returns the index within this string of the first occurrence of the specified character or -1, if the character does not occur.<\/p>\n<p>import java.io.*;<br \/>\npublic class Test {<\/p>\n<p>public static void main(String args[]) {<br \/>\nString Str = new String(&#8220;Bcis Notes.com&#8221;);<br \/>\nSystem.out.print(&#8220;Found Index :&#8221; );<br \/>\nSystem.out.println(Str.indexOf( &#8216;o&#8217; ));<br \/>\n}<br \/>\n}<\/p>\n<p><strong>Output<br \/>\n<\/strong>Found Index :7<\/p>\n<p><b>lastIndexOf<\/b><b>()<\/b><\/p>\n<p>This method returns the index of the last occurrence of the character in the character sequence represented by this object that is less than or equal to fromIndex, or -1 if the character does not occur before that point.<\/p>\n<p>import java.io.*;<br \/>\npublic class Test {<\/p>\n<p>public static void main(String args[]) {<br \/>\nString Str = new String(&#8220;Welcome to Tutorialspoint.com&#8221;);<br \/>\nSystem.out.print(&#8220;Found Last Index :&#8221; );<br \/>\nSystem.out.println(Str.lastIndexOf( &#8216;o&#8217; ));<br \/>\n}<br \/>\n}<\/p>\n<p><strong>Output<br \/>\n<\/strong>Found Last Index :27<\/p>\n<p><b>Trim()<\/b><\/p>\n<p>This method returns a copy of the string, with leading and trailing whitespace omitted.<br \/>\nimport java.io.*;<br \/>\npublic class Test {<\/p>\n<p>public static void main(String args[]) {<br \/>\nString Str = new String(&#8221; Bcis Notes.com &#8220;);<\/p>\n<p>System.out.print(&#8220;Return Value :&#8221; );<br \/>\nSystem.out.println(Str.trim() );<br \/>\n}<br \/>\n}<\/p>\n<p><strong>Output<br \/>\n<\/strong>Return Value :Bcis Notes.com<\/p>\n<p><b>ToUpperCase<\/b><b>()<\/b><\/p>\n<p>import java.io.*;<br \/>\npublic class Test {<\/p>\n<p>public static void main(String args[]) {<br \/>\nString Str = new String(&#8220;Bcis Notes.com&#8221;);<\/p>\n<p>System.out.print(&#8220;Return Value :&#8221; );<br \/>\nSystem.out.println(Str.toUpperCase() );<br \/>\n}<br \/>\n}<\/p>\n<p><strong>Outout<br \/>\n<\/strong>Return Value : BCIS NOTES.COM<\/p>\n<p><b>StringBuffer<\/b><\/p>\n<p>Java StringBuffer class is used to create a mutable (modifiable) string. The StringBuffer class in java is the same as String class except it is mutable i.e. it can be changed.<\/p>\n<table style=\"height: 226px;\" width=\"726\">\n<tbody>\n<tr>\n<td width=\"550\"><strong>Constructor<\/strong><\/td>\n<td width=\"550\"><strong>Description<\/strong><\/td>\n<\/tr>\n<tr>\n<td width=\"550\">StringBuffer()<\/td>\n<td width=\"550\">creates an empty string buffer with the initial capacity of 16.<\/td>\n<\/tr>\n<tr>\n<td width=\"550\">StringBuffer(String str)<\/td>\n<td width=\"550\">creates a string buffer with the specified string.<\/td>\n<\/tr>\n<tr>\n<td width=\"550\">StringBuffer(int capacity)<\/td>\n<td width=\"550\">creates an empty string buffer with the specified capacity as length.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>StringBuffer<\/b><\/p>\n<p>What is mutable string<br \/>\nA string that can be modified or changed is known as mutable string. StringBuffer and StringBuilder classes are used for creating mutable string.<\/p>\n<p><strong>1) StringBuffer append() method<\/strong><br \/>\nThe append() method concatenates the given argument with this string.<\/p>\n<p>class\u00a0StringBufferExample{<br \/>\npublic\u00a0static\u00a0void\u00a0main(String\u00a0args[]){<br \/>\nStringBuffer\u00a0sb=new\u00a0StringBuffer(&#8220;Hello\u00a0&#8220;);<br \/>\nsb.append(&#8220;Java&#8221;);\/\/now\u00a0original\u00a0string\u00a0is\u00a0changed<br \/>\nSystem.out.println(sb);\/\/prints\u00a0Hello\u00a0Java<br \/>\n}<br \/>\n}<\/p>\n<p><strong>2) StringBuffer insert() method<\/strong><br \/>\nThe insert() method inserts the given string with this string at the given position.<\/p>\n<p>class\u00a0StringBufferExample2{<br \/>\npublic\u00a0static\u00a0void\u00a0main(String\u00a0args[]){<br \/>\nStringBuffer\u00a0sb=new\u00a0StringBuffer(&#8220;Hello\u00a0&#8220;);<br \/>\nsb.insert(1,&#8221;Java&#8221;);\/\/now\u00a0original\u00a0string\u00a0is\u00a0changed<br \/>\nSystem.out.println(sb);\/\/prints\u00a0HJavaello<br \/>\n}<br \/>\n}<\/p>\n<p><strong>3) StringBuffer replace() method<\/strong><br \/>\nThe replace() method replaces the given string from the specified beginIndex and endIndex.<\/p>\n<p>class\u00a0StringBufferExample3{<br \/>\npublic\u00a0static\u00a0void\u00a0main(String\u00a0args[]){<br \/>\nStringBuffer\u00a0sb=new\u00a0StringBuffer(&#8220;Hello&#8221;);<br \/>\nsb.replace(1,3,&#8221;Java&#8221;);<br \/>\nSystem.out.println(sb);\/\/prints\u00a0HJavalo<br \/>\n}<br \/>\n}<\/p>\n<p><strong>4) StringBuffer delete() method<\/strong><br \/>\nThe delete() method of StringBuffer class deletes the string from the specified beginIndex to endIndex.<\/p>\n<p>class\u00a0StringBufferExample4{<br \/>\npublic\u00a0static\u00a0void\u00a0main(String\u00a0args[]){<br \/>\nStringBuffer\u00a0sb=new\u00a0StringBuffer(&#8220;Hello&#8221;);<br \/>\nsb.delete(1,3);<br \/>\nSystem.out.println(sb);\/\/prints\u00a0Hlo<br \/>\n}<br \/>\n}<\/p>\n<p><strong>5) StringBuffer reverse() method<\/strong><br \/>\nThe reverse() method of StringBuilder class reverses the current string.<\/p>\n<p>class\u00a0StringBufferExample5{<br \/>\npublic\u00a0static\u00a0void\u00a0main(String\u00a0args[]){<br \/>\nStringBuffer\u00a0sb=new\u00a0StringBuffer(&#8220;Hello&#8221;);<br \/>\nsb.reverse();<br \/>\nSystem.out.println(sb);\/\/prints\u00a0olleH<br \/>\n}<br \/>\n}<\/p>\n<p><strong>6) StringBuffer capacity() method<\/strong><br \/>\nThe capacity() method of StringBuffer class returns the current capacity of the buffer. The default capacity of the buffer is 16. If the number of character increases from its current capacity, it increases the capacity by (oldcapacity*2)+2. For example if your current capacity is 16, it will be (16*2)+2=34.<\/p>\n<p>class\u00a0StringBufferExample6{<br \/>\npublic\u00a0static\u00a0void\u00a0main(String\u00a0args[]){<br \/>\nStringBuffer\u00a0sb=new\u00a0StringBuffer();<br \/>\nSystem.out.println(sb.capacity());\/\/default\u00a016<br \/>\nsb.append(&#8220;Hello&#8221;);<br \/>\nSystem.out.println(sb.capacity());\/\/now\u00a016<br \/>\nsb.append(&#8220;java\u00a0is\u00a0my\u00a0favourite\u00a0language&#8221;);<br \/>\nSystem.out.println(sb.capacity());\/\/now\u00a0(16*2)+2=34\u00a0i.e\u00a0(oldcapacity*2)+2<br \/>\n}<br \/>\n}<\/p>\n<p>You may also like<a href=\"https:\/\/bcisnotes.com\/secondsemester\/interfaces-and-packages\/\">Interfaces and Packages || Inheritance, Interfaces and Packages || Bcis Notes<\/a><\/p>\n<p>&nbsp;<\/p>\n<div class=\"nczgb69f7f1ea9c015\" ><div id=\"amzn-assoc-ad-668fe681-bdc6-49ee-a9f9-a4c2f5be29a0\"><\/div><script async src=\"\/\/z-na.amazon-adsystem.com\/widgets\/onejs?MarketPlace=US&adInstanceId=668fe681-bdc6-49ee-a9f9-a4c2f5be29a0\"><\/script><\/div><style type=\"text\/css\">\r\n@media screen and (min-width: 1201px) {\r\n.nczgb69f7f1ea9c015 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 993px) and (max-width: 1200px) {\r\n.nczgb69f7f1ea9c015 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 769px) and (max-width: 992px) {\r\n.nczgb69f7f1ea9c015 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (min-width: 768px) and (max-width: 768px) {\r\n.nczgb69f7f1ea9c015 {\r\ndisplay: block;\r\n}\r\n}\r\n@media screen and (max-width: 767px) {\r\n.nczgb69f7f1ea9c015 {\r\ndisplay: block;\r\n}\r\n}\r\n<\/style>\r\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>String Buffer String Buffer The String Buffer class is used to create a mutable string. It is same as String class except it is mutable <a class=\"mh-excerpt-more\" href=\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/\" title=\"String Buffer || Java Collections And Java API Library || Bcis Notes\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":3,"featured_media":834,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>String Buffer || Java Collections And Java API Library || Bcis Notes<\/title>\n<meta name=\"description\" content=\"The String Buffer class is used to create a mutable string. It is same as String class except it is mutable and thread-safe.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"String Buffer || Java Collections And Java API Library || Bcis Notes\" \/>\n<meta property=\"og:description\" content=\"The String Buffer class is used to create a mutable string. It is same as String class except it is mutable and thread-safe.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/\" \/>\n<meta property=\"og:site_name\" content=\"BCIS NOTES\" \/>\n<meta property=\"article:published_time\" content=\"2019-09-03T08:16:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-05T05:50:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/string-buffer.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"340\" \/>\n\t<meta property=\"og:image:height\" content=\"230\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jelly\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jelly\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/\"},\"author\":{\"name\":\"Jelly\",\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/#\/schema\/person\/e546a21bf4bd6cef9112447a5f1453f6\"},\"headline\":\"String Buffer || Java Collections And Java API Library || Bcis Notes\",\"datePublished\":\"2019-09-03T08:16:07+00:00\",\"dateModified\":\"2020-05-05T05:50:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/\"},\"wordCount\":1452,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/#organization\"},\"image\":{\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/string-buffer.jpg\",\"articleSection\":[\"Object Oriented Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/\",\"url\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/\",\"name\":\"String Buffer || Java Collections And Java API Library || Bcis Notes\",\"isPartOf\":{\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/string-buffer.jpg\",\"datePublished\":\"2019-09-03T08:16:07+00:00\",\"dateModified\":\"2020-05-05T05:50:10+00:00\",\"description\":\"The String Buffer class is used to create a mutable string. It is same as String class except it is mutable and thread-safe.\",\"breadcrumb\":{\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#primaryimage\",\"url\":\"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/string-buffer.jpg\",\"contentUrl\":\"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/string-buffer.jpg\",\"width\":340,\"height\":230,\"caption\":\"String Buffer || Java Collections And Java API Library || Bcis Notes\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/bcisnotes.com\/secondsemester\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"String Buffer || Java Collections And Java API Library || Bcis Notes\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/#website\",\"url\":\"https:\/\/bcisnotes.com\/secondsemester\/\",\"name\":\"BCIS NOTES\",\"description\":\"Second Semester\",\"publisher\":{\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/bcisnotes.com\/secondsemester\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/#organization\",\"name\":\"BCIS NOTES\",\"url\":\"https:\/\/bcisnotes.com\/secondsemester\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/12\/cropped-2.jpg\",\"contentUrl\":\"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/12\/cropped-2.jpg\",\"width\":300,\"height\":100,\"caption\":\"BCIS NOTES\"},\"image\":{\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/#\/schema\/person\/e546a21bf4bd6cef9112447a5f1453f6\",\"name\":\"Jelly\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/bcisnotes.com\/secondsemester\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a1059d40f7ab5e57f2659e94306c6a9a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a1059d40f7ab5e57f2659e94306c6a9a?s=96&d=mm&r=g\",\"caption\":\"Jelly\"},\"url\":\"https:\/\/bcisnotes.com\/secondsemester\/author\/mandira\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"String Buffer || Java Collections And Java API Library || Bcis Notes","description":"The String Buffer class is used to create a mutable string. It is same as String class except it is mutable and thread-safe.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/","og_locale":"en_US","og_type":"article","og_title":"String Buffer || Java Collections And Java API Library || Bcis Notes","og_description":"The String Buffer class is used to create a mutable string. It is same as String class except it is mutable and thread-safe.","og_url":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/","og_site_name":"BCIS NOTES","article_published_time":"2019-09-03T08:16:07+00:00","article_modified_time":"2020-05-05T05:50:10+00:00","og_image":[{"width":340,"height":230,"url":"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/string-buffer.jpg","type":"image\/jpeg"}],"author":"Jelly","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Jelly","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#article","isPartOf":{"@id":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/"},"author":{"name":"Jelly","@id":"https:\/\/bcisnotes.com\/secondsemester\/#\/schema\/person\/e546a21bf4bd6cef9112447a5f1453f6"},"headline":"String Buffer || Java Collections And Java API Library || Bcis Notes","datePublished":"2019-09-03T08:16:07+00:00","dateModified":"2020-05-05T05:50:10+00:00","mainEntityOfPage":{"@id":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/"},"wordCount":1452,"commentCount":0,"publisher":{"@id":"https:\/\/bcisnotes.com\/secondsemester\/#organization"},"image":{"@id":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#primaryimage"},"thumbnailUrl":"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/string-buffer.jpg","articleSection":["Object Oriented Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/","url":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/","name":"String Buffer || Java Collections And Java API Library || Bcis Notes","isPartOf":{"@id":"https:\/\/bcisnotes.com\/secondsemester\/#website"},"primaryImageOfPage":{"@id":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#primaryimage"},"image":{"@id":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#primaryimage"},"thumbnailUrl":"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/string-buffer.jpg","datePublished":"2019-09-03T08:16:07+00:00","dateModified":"2020-05-05T05:50:10+00:00","description":"The String Buffer class is used to create a mutable string. It is same as String class except it is mutable and thread-safe.","breadcrumb":{"@id":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#primaryimage","url":"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/string-buffer.jpg","contentUrl":"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/09\/string-buffer.jpg","width":340,"height":230,"caption":"String Buffer || Java Collections And Java API Library || Bcis Notes"},{"@type":"BreadcrumbList","@id":"https:\/\/bcisnotes.com\/secondsemester\/object-oriented-programming\/string-buffer\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/bcisnotes.com\/secondsemester\/"},{"@type":"ListItem","position":2,"name":"String Buffer || Java Collections And Java API Library || Bcis Notes"}]},{"@type":"WebSite","@id":"https:\/\/bcisnotes.com\/secondsemester\/#website","url":"https:\/\/bcisnotes.com\/secondsemester\/","name":"BCIS NOTES","description":"Second Semester","publisher":{"@id":"https:\/\/bcisnotes.com\/secondsemester\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/bcisnotes.com\/secondsemester\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/bcisnotes.com\/secondsemester\/#organization","name":"BCIS NOTES","url":"https:\/\/bcisnotes.com\/secondsemester\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bcisnotes.com\/secondsemester\/#\/schema\/logo\/image\/","url":"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/12\/cropped-2.jpg","contentUrl":"https:\/\/bcisnotes.com\/secondsemester\/wp-content\/uploads\/2019\/12\/cropped-2.jpg","width":300,"height":100,"caption":"BCIS NOTES"},"image":{"@id":"https:\/\/bcisnotes.com\/secondsemester\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/bcisnotes.com\/secondsemester\/#\/schema\/person\/e546a21bf4bd6cef9112447a5f1453f6","name":"Jelly","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/bcisnotes.com\/secondsemester\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a1059d40f7ab5e57f2659e94306c6a9a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a1059d40f7ab5e57f2659e94306c6a9a?s=96&d=mm&r=g","caption":"Jelly"},"url":"https:\/\/bcisnotes.com\/secondsemester\/author\/mandira\/"}]}},"_links":{"self":[{"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/posts\/605"}],"collection":[{"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/comments?post=605"}],"version-history":[{"count":5,"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/posts\/605\/revisions"}],"predecessor-version":[{"id":1014,"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/posts\/605\/revisions\/1014"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/media\/834"}],"wp:attachment":[{"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/media?parent=605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/categories?post=605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bcisnotes.com\/secondsemester\/wp-json\/wp\/v2\/tags?post=605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}