In this tutorial, We will introduce you about the isUpperCase() method of character class.
Example for isUpperCase() method of character class
In this tutorial, We will introduce you about the isUpperCase() method of character class. This method specifies whether the given character is Upper Case or not. This method returns true when character is in upper case and false when character is not in upper case.
Example:CharacterIsUpperCase.java
package com.devmanuals;
public class CharacterIsUpperCase {
public static void main(String[] args) {
System.out.print("Is character G is UpperCase= ");
System.out.println(Character.isUpperCase('G'));
System.out.print("Is character g is UpperCase= ");
System.out.println(Character.isUpperCase('g'));
System.out.print("Is character H is UpperCase= ");
System.out.println(Character.isUpperCase('H'));
}
}
Output:
Is character G is UpperCase= true Is character g is UpperCase= false Is character H is UpperCase= true |
[ 0 ] Comments