Monday, October 8, 2018

Character Class in Java



Character is a class of java.lang package. Character  is a simple wrapper class and constructor of this class is Character (char ch), where the char ch is wrapped by the Character  object. Character class has several static methods which are used for several purposes


Return Type
Prototype
Use
boolean
static boolean isDigit (char ch)
Returns true if the argument character is digit otherwise false
boolean
static boolean isLetter (char ch)
Returns true if the argument character is an alphabet  otherwise false
boolean
static boolean isLetterOrDigit (char ch)
Returns true if the argument character is digit or alphabet otherwise false
boolean
static boolean isLowerCase (char ch)
Returns true if the argument character is a lowercase letter otherwise false
boolean
static boolean isUpperCase (char ch)
Returns true if the argument character is a uppercase letter otherwise false
boolean
static boolean isWhitespace (char ch)
Returns true if the argument character is a white space otherwise false
char
static char toLowerCase (char ch)
Returns lower case equivalent of the argument  character if it is in upper case otherwise returns the same value
char
static char toUpperCase (char ch)
Returns upper case equivalent of the argument  character if it is in lower case otherwise returns the same value


Related Post: Programs on Character Class

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner