StringBuffer sb = new StringBuffer(s6);//ConstructorSystem.out.println(sb.length());//lengthSystem.out.println(sb.capacity());//capacitysb.setLength(4);System.out.println(sb);//setlengthchar m1 = sb.charAt(1);sb.setCharAt(3,'E');//charAt and setCharAtSystem.out.println(m1);System.out.println(sb);sb.append("PQR").insert(7,"66").append(55).delete(7,8).deleteCharAt(8).replace(6,8,"MNP").reverse();//append, insert, delete, deleteCharAt, replace, reversesb.substring(2,7);//substringSystem.out.println(sb);}}Questions:1.
Write a program to replace an entered word with “Hello”
Demonstrate equals() and == with a program.3.
Count and all the repeated appearance of an entered word. Replace each one with anew word interactively.4.
Use a String, reverse it and concatenate both and store them in a new String. Find thelength, reverse each character of the resultant string.5.
Use a sentence, reverse each word, characterwise and wordwise.6.
Convert the starting word’s char of a sentence to
Take a String, replace the first char from the left with the last char from right, till itleft coincides with right.8.
Take a string find the repeating chars in it replace them with some other char that isentered through the keyboard.