//Judgment statement
If (! r.hasNextInt()) {
System.out.println ("Please enter an integer!" );
} Otherwise {
int a;
a = in . nextint();
}