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

 
 

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

Advertisement

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


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: June 26, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com