📅  最后修改于: 2022-03-11 14:52:17.849000             🧑  作者: Mango
// Using bitwise AND
if((n&1)==0)
System.out.println("n is even");
else
System.out.println("n is odd");
// Using bitwise OR
if((n|1)>n)
System.out.println("n is even");
else
System.out.println("n is odd");