In this example, We will inform you about the isDigit() method of the character class.
Example for isLetter() method in Java
In this example, We will inform you about the isDigit() method of the character class. This method specifies that the given character is a letter or not. This method returns the Boolean value true if the character is letter otherwise it returns false. Here is the example as .
Example:CharacterisLetter.java
package com.devmanuals; public class CharacterIsLetter { public static void main(String[] args) { System.out.print("Is character A is letter= "); System.out.println(Character.isLetter('A')); System.out.print("Is character 9 is letter= "); System.out.println(Character.isLetter('9')); System.out.print("Is character @ is letter= "); System.out.println(Character.isLetter('@')); } }
Output:
Is character A is letter= true Is character 9 is letter= false Is character @ is letter= false |
[ 0 ] Comments