bit more complex but easy to understand. When youset a value on a string variable, before reserve a space on yourheap, the JVM look if this string already exists in the pool. In casethere is one string exactly equal, in spite of creating anotherobject, it just point to that existing string, but be careful becausethis won't happen if call a string method or instantiate calling thenew keyword. Lookthose examples:Stringvar5= "LET'SSURF IN RIO";//newStringStringvar6= "Let'ssurf in Rio Baby!";//newStringStringvar7= "Let'ssurf in Rio";//newStringStringvar8= "Let'ssurf in Rio";//alreadyexist, not a new stringStringvar9= newString("Let'ssurf in Rio");//callingnewword it always make a new objectStringvar10= var9.toLowerCase();//callinga string method it will create a new object tooMetodosString Thereare many good method to use on your daily at work. Those methods canhelp you a lot. I like to recommend oracledocumentationevery time you are in doubt or need to learn a bit more about how amethod works and its examples. Incase you haven't been presented to those methods, here are theprinciples methods used in my daily just to have an idea .CharAt( ) - It will return the character in the specific indice of the string.String aux = "0123456789";System.out.println("aux.charAt(5) = "+aux.charAt(5));Console: aux.charAt(5) = 5Concat()= Add text at the end of the actual string variable, also can be used by the plus mark (+).String aux = "0123456789 ";aux += aux.concat(aux);System.out.println("aux = "+aux);Console: aux = 0123456789 0123456789 0123456789toUpperCase:Create a new string with its charterers in upper case.String aux = "testMyString";System.out.println(aux.toUpperCase());Console:TESTMYSTRINGtoLowerCase:Create a new string with its charterers in lower case.String aux = "testMyString";System.out.println(aux.toLowerCase());Console:testmystringequalsIgnoreCase( ): Verify if two strings are equals disregarding if the character is upper case or lower case.String aux = "testMyString";System.out.println(aux.toLowerCase().equalsIgnoreCase(aux.toUpperCase()));Console:trueLength(): Measures the number of characters that a string has.String aux = "01234";System.out.println(aux.length());Console:5Replace(oldChar,newChar): Replace characters in a string, the oldChar parameter should be the character that will be replaced and the newChar parameter to place the new character.String aux = "testMyString";System.out.println(aux.replace("t","X"));Console: XesXMySXringtrim() : Remove spaces from the beginning and end of your string.aux = " test My String ";System.out.println("*"+aux+"*");System.out.println("*"+aux.trim()+"*")Console:* test My String **test My String*StringBuffere StringBuilder StringBufferand StringBuilder are two classes that have many things in common,starting with their methods that work exactly the same. Ispossible to do many different things with strings when using thosemethods and the good thing, is that when you manipulate strings usingStringBuilder or StringBuffer class methods you don't create anotherobject, leaving your pool free of objects that you won't need. Proceedingwhat I mentioned, StringBuilderand StringBuffer are almost exactly the same. The onlydifference is that StringBufferis synchronized,it means that is more secure to useStringBuffer when you intend to develop to a multi threadenvironment. Inthe other hand,StringBuilder ismuch more faster to execute, once it doesn't need to be careful withthreads. Even tho if you look in Oracle API documentation you willsee that they recommend, or at least give preference to StringBuilderand personalize your synchronize method onthe way your application will need. Hereare some examples of code comparing String, StringBuffer andStringBuilder. String testString= "surfing"; StringBuilder testStringBuilder= newStringBuilder("surfing"); StringBuffer testStringBuffer= newStringBuffer("surfing"); testString.concat("in Rio!"); testStringBuffer.append("in Rio!"); testStringBuilder.append("in Rio!"); System.out.println("testString= "+testString); System.out.println("testStringBuffer= "+testStringBuffer); System.out.println("testStringBuilder= "+testStringBuilder); testString= testString.concat("in Rio!"); System.out.println(">>testString = "+testString);Console:testString= surfingtestStringBuffer= surfing in Rio!testStringBuilder= surfing in Rio!>>testString