Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
可能重复: Java 运算符:|= bitwise OR and assign示例
|= bitwise OR and assign
boolean bAlive; bAlive |= this.properties.containsKey(name);
在上面,代码使用'|'. 为什么使用'|' ?
'|'
'|
提前致谢。
布尔值与右侧的值进行或运算。
如果this.properties.containsKey(name)是TRUE,则bAlive设置为TRUE。
this.properties.containsKey(name)
TRUE
bAlive
否则,bAlive保持不变。