Java examples for Language Basics:char
Determining the Type of a Character
public class Main { public void m() throws Exception { char ch = 'a'; if (Character.isLetter(ch)) { // true }// ww w. jav a 2 s .co m if (Character.isDigit(ch)) { // false } if (Character.isLowerCase(ch)) { // true } if (Character.isUpperCase(ch)) { // false } // See Character for more methods. } }