Java String Add Char Code Example

Snippet 1
  char ch='A';
String str="pple";
str= ch+str;   // str will change to "Apple" 
Snippet 2
  StringBuilder sbf = new StringBuilder("Welcome geeks!"); 
System.out.println( sbf); //will print "Welcome geeks!"

sbf.append('T'); 
System.out.println( sbf); //will print "Welcome geeks!T"