Menu
Question Index
...

What will be the output of the following program?

public class Offset {
    public static void main(String args[]) {
        StringBuffer ng = new StringBuffer("The list of files ");
        int i = ng.offsetByCodePoints(3, 8);
        System.out.print(i + ",");
        ng.append("contains sub files");
        ng.trimToSize();
        System.out.print(ng);
    }
}


10,The list of files contains sub
11,The list of files contains sub files
11,The list of contains sub files
Compilation Error or Runtime Error

Doubts

Problems

Topic: Additional StringBuffer Methods In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App