Menu
Question Index
...

What will be the output of the following program?

public class Countcode {
    public static void main(String args[]) {
        StringBuffer sub = new StringBuffer("STRINGBUFFER");
        int c = sub.codePointCount(5, 10);
        System.out.println("Count: " + c);
        StringBuffer sub1 = new StringBuffer("STRINGBUILDER");
        c = sub1.codePointCount(1, 5);
        System.out.print("Count: " + c);
    }
}


Count: 5
Count: 5
Count: 5
Count: 4
Count: 4
Count: 4
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