Skip to content

Commit 4a4b480

Browse files
加上注释
1 parent c13bc21 commit 4a4b480

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/com/bit/BitDemo.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class BitDemo {
99

1010
/**
1111
*
12-
12+
* &运算(与运算):两个二进制操作数对应位同为1 结果位 才为1,其余情况为0;
1313
* &运算(与运算)中1&1=1,1&0=0,0&0=0
1414
1515
* 8 & 7 的运算步骤如下:
@@ -40,6 +40,7 @@ public static void andDemo() {
4040

4141

4242
/**
43+
* |运算 (或运算):两个二进制操作数对应位只要有一个为1 结果位 就为1,其余情况为0;
4344
* |运算 (或运算). 1|1=1,1|0=1,0|0=0
4445
*
4546
* 8 | 7 的运算步骤如下:
@@ -58,7 +59,7 @@ public static void orDemo() {
5859

5960

6061
/**
61-
* 异或 a ^ b 相同为0,相异为1
62+
* 异或 a ^ b :两个二进制操作数对应位,相同为0,相异为1
6263
*
6364
*/
6465
public static void xorDemo() {
@@ -69,7 +70,7 @@ public static void xorDemo() {
6970

7071

7172
/**
72-
* ~ 取反 ~a 0的为1,1的为0
73+
* ~ 取反 ~a:二进制操作数 0的为1,1的为0
7374
*
7475
*/
7576
public static void reverseDemo() {

0 commit comments

Comments
 (0)