-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathExample.java
More file actions
25 lines (20 loc) · 748 Bytes
/
Example.java
File metadata and controls
25 lines (20 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package com.example;
public class Example {
public static final int
FLAG_1 = 2,
FLAG_2 = 4,
FLAG_3 = 8,
FLAG_4 = 16;
public static void main(String[] args) {
applyFlags(Example.FLAG_1);
applyFlags(Example.FLAG_1 | Example.FLAG_2);
applyFlags(Example.FLAG_3 | Example.FLAG_4 | Example.FLAG_1 | 129);
applyFlags(-1);
applyFlags(~(Example.FLAG_1 | Example.FLAG_2));
applyFlags(~Example.FLAG_4);
applyFlags((Example.FLAG_4 * 21) | Example.FLAG_3);
applyHexFlags(Example.FLAG_3 | Example.FLAG_4 | Example.FLAG_1 | 0x81);
}
public static void applyFlags(int flags) {}
public static void applyHexFlags(int flags) {}
}