int a = in.nextlnt();晕nextInt写成L了。纠结。
修改为
import java.util.Scanner;
public class EvenOdd{
public static void main(String args[]){
Scanner in = new Scanner(System.in);
System.out.println("请输入要检测的整数");
int a = in.nextInt();
while(a==0){
System.out.println("输入错误,不能为零。请重新输入整数!");
a = in.nextInt();
}
if(a%2 == 0)
System.out.println(a + " 为偶数。");
else
System.out.println(a + " 为奇数。");