This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
|
java:operators [2021/02/28 16:29] gthanos [Δυαδικοί τελεστές και τελεστές ολίσθησης] |
java:operators [2021/02/28 16:32] gthanos [Δυαδικοί τελεστές και τελεστές ολίσθησης] |
||
|---|---|---|---|
| Line 178: | Line 178: | ||
| | %%^%% | δυαδικό αποκλειστικό OR (exclusive OR) | | | %%^%% | δυαδικό αποκλειστικό OR (exclusive OR) | | ||
| - | <code java BitDemo.java> | + | <code java BitOperatorsDemo.java> |
| class BitOperatorsDemo { | class BitOperatorsDemo { | ||
| public static void main(String[] args) { | public static void main(String[] args) { | ||
| int bitmask = 0x000F; | int bitmask = 0x000F; | ||
| - | int val = 0x2222; | + | int val = 0x4444; |
| - | // prints | + | // prints |
| System.out.println(" | System.out.println(" | ||
| + | // prints 16 | ||
| System.out.println(" | System.out.println(" | ||
| + | // prints 2 | ||
| System.out.println(" | System.out.println(" | ||
| - | System.out.println(" | + | |
| + | | ||
| } | } | ||
| } | } | ||