we can create String in 4 ways in Java:
- as character array char n[] = {'n','i','i','t'};
- by create an object with string class String s1 = new String('niit');
- String s2 = "niit"; without a new keyword
- by Stringbuffer class object. StringBuffer b1 = new StringBuffer("niit")
StringBuffer is another String type mutable class. mutable means modified. we can modify it after the creation