Menu
Question Index
...

What will be the output of the following program?

public class Codepoint {
    public static void main(String args[]) {
        StringBuffer sub = new StringBuffer("Mango");
        int c = sub.codePointAt(2);
        System.out.println("Code point at given char: " + c);
        int d = sub.codePointBefore(2);
        System.out.println("Code point before char: " + d);
    }
}


Code point at given char: 111
Code point before char: 97
Code point at given char: 110
Code point before char: 96
Code point at given char: 110
Code point before char: 97
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