使用按位运算符有两种情况:
对于布尔值
boolean a = true;
boolean b= false;
boolean c = a|b; // Giving response after logical OR for booleans.
对于整数
int a = 10;
int b = 20;
int c = a|b; // Giving response after bitwise OR for boolean equivalents of "a" and "b".
以上两种情况均符合http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.22.2。
是运营商| 超载?
我只是想问一个非常简单的问题:是“|” 重载或它对布尔值(当然是二进制等价物)和整数执行相同的按位或任务?