📌  相关文章
📜  在java代码示例中使用按位和

📅  最后修改于: 2022-03-11 14:52:34.486000             🧑  作者: Mango

代码示例1
// 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");