public class Test {
public static void main(String[] args) {
for (int i = 0; i <= 10; i++) {
System.out.println(i + (isEvenNumber(i) ? "是偶数" : "是奇数"));
}
}
private static boolean isEvenNumber(int n) {
return (((n >> 1) << 1) == n);
}
}
int t ;
if(t&1==0)//则为偶数