Table of Contents
Character class’s isletter method can be used to check if character is letter or not.
Method signature
1 2 3 |
public static boolean isLetter(char ch): |
Parameters
ch is primitive character type.
Return type
boolean is primitive character type.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
package org.arpit.java2blog; public class JavaIsLetterMain { public static void main(String[] args) { System.out.println(Character.isLetter('a')); System.out.println(Character.isLetter('Y')); System.out.println(Character.isLetter('5')); System.out.println(Character.isLetter('&')); } } |
When you run above program, you will get below output:
true
false
false
That’s all about java Character’s isletter method.