import java.util.Scanner; /*-------------------------------------  IF文 文字の判定 -------------------------------------*/ public class If04CharCheck { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String keybd; char ch; System.out.print("文字を入力して下さい-->"); keybd=sc.nextLine(); ch=keybd.charAt(0); if (ch>=0x41 && ch<=0x5a) System.out.print("\n大文字です"); else if (ch>=0x61 && ch<=0x7a) System.out.print("\n小文字です"); else if (ch>=0x30 && ch<=0x39) System.out.print("\n数字です"); else System.out.print("\n英数字以外です"); } }