java.lang.StringBuffer codePointAt(int index)

Description :

This java tutorial shows how to use the codePointAt(int index) method of StringBuffer class under java.lang package.

The codePointAt(int index) returns the character (Unicode code point) at the specified index. The index refers to char values. Make a note that the index ranges from 0 to length() – 1.

Method Syntax :

public int codePointAt(int index)

Parameter Input :

DataType Parameter Description
int index index to the char values

Method Returns :

The codePointAt(int index) method simply returns ode point value of the character at the index.

Compatibility Version :

Requires Java 1.5 and up

Java Code Example :

This java example source code demonstrates the use of codePointAt(int index) method of StringBuffer class. Initially the code assigns a string “java-tutorial” as initial contents of the string buffer. Then we use the codePointAt of the StringBuffer at index 3.

Sample Output :

Running the codePointAt(int index) method example source code of StringBuffer class will give you the following output

Exception Scenario :

N/A

Similar Method :

  • N/A

Suggested Reading List :

References :