Java Data Type Tutorial - Java Character.toUpperCase(int codePoint)








Syntax

Character.toUpperCase(int codePoint) has the following syntax.

public static int toUpperCase(int codePoint)

Example

In the following code shows how to use Character.toUpperCase(int codePoint) method.

public class Main {
/*from   w  w  w  . ja v a2 s  .  c om*/
  public static void main(String[] args) {
    int cp1 = 0x0071; 
    int cp2 = 0x0570; 

    int cp3 = Character.toUpperCase(cp1);
    int cp4 = Character.toUpperCase(cp2);

    String str1 = "Uppercase equivalent of " + cp1 + " is " + cp3;
    String str2 = "Uppercase equivalent of " + cp2 + " is " + cp4;

    System.out.println(str1);
    System.out.println(str2);
  }
}

The code above generates the following result.