Home Tutorial Java Corejava Check character in upper case or not.

 
 

Check character in upper case or not.
Posted on: June 26, 2010 at 12:00 AM
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

Related Tags for Check character in upper case or not.:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.