Menu
Topics Index
...
`

Find codePoint


If you need explanation Read this topic

Find codePoint
What will be the output of the following program?
public class codePoint {
    public static void main(String[] args) {
        int point, position = 1, length = 4;
        char[] charArray = new char[]{'J', 'a', 'v', 'a'};
        point = Character.codePointAt(charArray, position, length);
        System.out.println(point);
    }
}

A. 74
B. 97
C. Compilation Error
D. Runtime Error
Topic: Character Unicode, Code Point Support In Java

If you need explanation Read this topic

User comments below. All of them might not be correct.

Ans is C.. codePintAt should contain length-1.. array Index out of bounds exception..

Posted by Om Prakash Om    2014-06-06 03:55:34


option b is corect..that method wil retrn the unicode point of the given index

Posted by Vijay Kumar    2014-06-06 04:01:20


No winner for this dose. Correct option is 'B' :(. Vijay Kumar was already won in this week.

Posted by Merit Campus    2014-06-09 11:40:07


© meritcampus 2019

All Rights Reserved.

Open In App