---
# System prepended metadata

title: '[Java] 運算'
tags: [Java]

---

# [Java] 運算
###### tags: `Java`

## Bitwise Operators 位元運算

```=java
// bitwise or
int c= a | b;
 
// bitwise and
int d= a & b;
 
// bitwise xor
int e= a ^ b;
 
// bitwise not
int f= (~a & b)|(a &~b);
int g= ~a & 0x0f;
```

[Bitwise Operators in Java](https://www.geeksforgeeks.org/bitwise-operators-in-java/)