Java Character isLetter() MethodThe isLetter(char ch) method of Character class determines whether the given(or specified) character is a letter or not. A character is considered to be a letter if the general category type provided by the Character.getType(ch) is one of the following:
SyntaxParameterch: It is the character that needs to be tested. Return ValueThe isLetter(char ch) method returns a Boolean value i.e. true if the given(or specified) character is a letter. Otherwise, the method returns false. Example 1Output: The character A is a letter: true The character 9 is a letter: false The character e is a letter: true Example 2Output: The character 1 is a letter: false The character * is a letter: false The character e is a letter: true Example 3Output: The character 1 is a letter: false The character ) is a letter: false The character * is a letter: false Java Character isLetter(int codePoint) MethodThe isLetter(int codePoint) method of character class determines whether the given(or specified) character is a letter or not. A character is considered to be a letter if the general category type provided by the Character.getType(codePoint) is one of the following:
SyntaxParameterThe above method requires only one parameter: a.)The codePoint which is the character that needs to be tested. Return ValueThe isLetter(int codePoint)method returns a boolean value i.e. true, if the given(or specified) character is a letter. Otherwise, the method returns false. Example 4Output: The first codePoint 56 is a letter: false The second codePoint 110 is a letter: true The third codePoint 123 is a letter: false The fourth codePoint 315 is a letter: false Example 5Output: Enter the first input:8 The character '8' is not a letter. Enter the second input:T The character 'T' is a letter. Enter the third input:& The character '&' is a letter. Next TopicJava-character-isletterordigit-method |