判断奇数和偶数 int c = 3; int b = 4; if((c & 1) == 1){ System.out.println("奇数"); } if((b & 1 ) == 0){ System.out.println("偶数"); }