Check character in upper case or not.


 

Check character in upper case or not.

This example check for the character in uppercase or not.

This example check for the character in uppercase or not.

Description:

This tutorial demonstrate the use of Character.isUpperCase() method for rectifying whether the value stored in char is in uppercase or not.

Code:

public class CheckUpper {
  public static void main(String args[]) {
    char charVar = 'A';
    if (Character.isUpperCase(charVar)) {
      System.out.println("true");
    else {
      System.out.println("false");
    }
  }
}

Output:

Download this code

Ads