/*----------------------------------------------- if文 文字の判定  ------------------------------------------------*/ import java.util.*; 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"); } }