sb.append(" kumari"); //mutable String and we can append any string to the existing string. System.out.println(sb); System.out.println(sb.capacity()); //actually capacity is 16 characters // So once ...
We know that Strings are immutable or constants but String builder and String buffer are basically used to provide dynamic implementation of Strings. But String Builder is not thread safe that means ...
import java.util.*; public class StringBufferExample{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); String str1=sc.nextLine(); String ...