![]() If the index value is greater than the string length, this method throws the StringIndexOutOfBoundsException. The character code point value of the 3rd index is: 97 On executing the above program, it will produce the following result − ("The character code point value of the " + index + "rd index is: " + str.codePointAt(index)) String str = new String("JavaProgramming") Then, using the codePointAt() method, we are trying to retrieve the character code point value at index 3. In the following example, we are creating an object of the string class with the value “JavaProgramming”. If the index value is positive and less than the string length, this method returns the character code point at the specified index. This method returns the code point value of the character at the index.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |