java tutorial - Java - Method Character.isLetter() - java programming - learn java - java basics - java for beginners



Java characters isletter

Learn Java - Java tutorial - Java characters isletter - Java examples - Java programs

Description

  • The Character.isLetter() method in Java determines whether the specified char value is a letter.

Syntax

boolean isLetter(char ch)
click below button to copy the code. By - java tutorial - team

Options

  • Detailed information about the parameters:
    • ch is a primitive character type (char).

Return value

  • In Java, Character.isLetter() returns true if the passed character is a letter.

Sample Code

public class Test {

   public static void main (String args []) {
      System.out.println ("Value \"w\"letter? Answer:" + Character.isLetter ('w'));
      System.out.println ("Value \"K\"letter? Answer:" + Character.isLetter ('K'));
      System.out.println ("Value \"1\"letter? Answer:" + Character.isLetter ('1'));
      System.out.println ("Value \"!\"Letter? Answer:" + Character.isLetter ('!'));
      System.out.println ("Value \"&\"letter? Answer:" + Character.isLetter ('&'));
   }
}
click below button to copy the code. By - java tutorial - team

Output

Value "w"letter? Answer:true
Value "K"letter? Answer:true
Value "1"letter? Answer:false
Value "!"Letter? Answer:false
Value "&"letter? Answer:false

Related Searches to Java - Method Character.isLetter()