What is Character.isLetter() in JAVA?

The isLetter() function returns true if the character sent as a parameter is letter; otherwise, it returns false.

Figure 1 shows a visual representation of the isLetter() function.

Figure 1: Visual representation of the isLetter() function

Syntax

boolean isLetter(char character)

Parameter

The isLetter() function takes the character as a parameter.

Return value

The isLetter() function returns true if the character sent as a parameter is letter; otherwise, it returns false.

Code

class JAVA {
public static void main( String args[] ) {
//simple letter
System.out.println("Character.isLetter('E'):");
System.out.println(Character.isLetter('E'));
//other character
System.out.println("Character.isLetter('*'):");
System.out.println(Character.isLetter('*'));
//digit character
System.out.println("Character.isLetter('5'):");
System.out.println(Character.isLetter('5'));
}
}
New on Educative
Learn to Code
Learn any Language as a beginner
Develop a human edge in an AI powered world and learn to code with AI from our beginner friendly catalog
🏆 Leaderboard
Daily Coding Challenge
Solve a new coding challenge every day and climb the leaderboard

Free Resources