1. isLetter() Method Example
Description : isLetter() Method determines whether the specified char value is a letter.public class MethodOne {
public static void main(String args[]){
System.out.println(Character.isLetter('A'));
System.out.println(Character.isLetter('6'));
System.out.println(Character.isLetter('x'));
}
}
Output :
true false true.2. isDigit() Method Example
Description : isDigit() Method determines whether the specified char value is a digit.public class MethodTwo {
public static void main(String args[]) {
System.out.println(Character.isDigit('10'));
System.out.println(Character.isDigit('B'));
System.out.println(Character.isDigit('5'));
} }
Output :
true false true.3. isWhitespace() Method Example
Description : isWhitespace() Method determines whether the specified char value is a white space, which includes space, tab, or new line.public class MethodThree{
public static void main(String args[] ) {
System.out.println(Character.isWhitespace('B'));
System.out.println(Character.isWhitespace(' '));
System.out.println(Character.isWhitespace('\n'));
System.out.println(Character.isWhitespace('\f'));
System.out.println(Character.isWhitespace('\t'));
}
}
Output :
false true true true true.4. isUpperCase() Method Example
Description : isUpperCase() Method determines whether the specified char value is uppercase.public class MethodFour{
public static void main(String args[] ) {
System.out.println(Character.isUpperCase('B'));
System.out.println(Character.isUpperCase('10'));
System.out.println(Character.isUpperCase('b'));
System.out.println(Character.isUpperCase('\f'));
System.out.println(Character.isUpperCase('\t'));
}
}
Output :
true false false false false.5. isLowerCase() Method Example
Description : isLowerCase() Method determines whether the specified char value is uppercase.public class MethodFour{
public static void main(String args[] ) {
System.out.println(Character.isLowerCase('B'));
System.out.println(Character.isLowerCase('10'));
System.out.println(Character.isLowerCase('b'));
System.out.println(Character.isLowerCase('\f'));
System.out.println(Character.isLowerCase('\t'));
}
}
Output :
false false true false false.6. toUpperCase() Method Example
Description : toUpperCase() Method determines whether the specified char value is uppercase.public class MethodFour{
public static void main(String args[] ) {
System.out.println(Character.toUpperCase('B'));
System.out.println(Character.toUpperCase('K'));
System.out.println(Character.toUpperCase('b'));
System.out.println(Character.toUpperCase('n'));
}
}
Output :
B K B N.7. toLowerCase() Method Example
Description : toLowerCase() Method returns the lowercase form of the specified char value.public class MethodFour {
public static void main(String args[] ) {
System.out.println(Character.toLowerCase('B'));
System.out.println(Character.toLowerCase('K'));
System.out.println(Character.toLowerCase('k'));
System.out.println(Character.toLowerCase('n'));
}
}
Output :
b k k n.8. toString() Method Example
Description : toString() Method returns a String object representing the specified character value, that is, a one-character string.public class MethodFive {
public static void main(String args [] ) {
System.out.println(Character.toString('B'));
System.out.println(Character.toString('12'));
System.out.println(Character.toString('z'));
}
}