try this
Scanner in=new Scanner(System.in);
char ch ;
do{
System.out.println("Enter the a character");
try{
ch= in.nextLine().charAt(0);
System.out.println("Char: "+ch);
}
catch (IndexOutOfBoundsException e) {
ch = 'z';
}
}while(ch < 'a' || ch > 'g');