The method codePointAt() takes an int as a parameter and returns the code point at the specified index. A code point is a decimal value that the character is given in the Unicode standard.

Available Signatures

public int codePointAt(int index)

Example

@Test
public void whenCallCodePointAt_thenDecimalUnicodeReturned() {
    assertEquals(97, "abcd".codePointAt(0));
}

Throws

  • StringIndexOutOfBoundsException – if a non-existent index is passed to the method.
@Test(expected = StringIndexOutOfBoundsException.class)
public void whenPassNonExistingIndex_thenStringIndexOutOfBoundsExceptionThrown() {
    int a = "abcd".codePointAt(4);
}
Next »
Java String.concat()
« Previous
Java String.codePointCount()
Partner – Moderne – NPI EA (tag=Refactoring)
announcement - icon

Modern Java teams move fast — but codebases don’t always keep up. Frameworks change, dependencies drift, and tech debt builds until it starts to drag on delivery. OpenRewrite was built to fix that: an open-source refactoring engine that automates repetitive code changes while keeping developer intent intact.

The monthly training series, led by the creators and maintainers of OpenRewrite at Moderne, walks through real-world migrations and modernization patterns. Whether you’re new to recipes or ready to write your own, you’ll learn practical ways to refactor safely and at scale.

If you’ve ever wished refactoring felt as natural — and as fast — as writing code, this is a good place to start.

Course – Black Friday 2026 – NPI EA – main – after_post_content

announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 4th December, 2026 at 18:00 Romania time:

>> EXPLORE ACCESS NOW

Course – Black Friday 2026 – NPI – main – after_post_content

announcement - icon

Yes, we're now running our Black Friday Sale. All Courses are 33% off until 4th December, 2026 at 18:00 Romania time:

>> EXPLORE ACCESS NOW