Menu
Question Index
...

What will be the output of the following program?

public class Delete {
    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer("This is Merit Campus program");
        StringBuffer str = sb.delete(14, 21);
        System.out.println(str);
        System.out.println(sb);
        sb.deleteCharAt(4);
        System.out.println(sb);
    }
}


Campus
This is Merit program
Thisis Merit program
Campus
This is Meritprogram
Thisis Merit program
This is Merit program
This is Mersprogram
Thisis Merit program
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Java delete() and deleteCharAt() Methods In StringBuffer

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App