java:operators
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
java:operators [2021/02/28 16:29] – [Δυαδικοί τελεστές και τελεστές ολίσθησης] gthanos | java:operators [2021/02/28 16:38] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 178: | Line 178: | ||
| %%^%% | δυαδικό αποκλειστικό OR (exclusive OR) | | | %%^%% | δυαδικό αποκλειστικό OR (exclusive OR) | | ||
- | <code java BitDemo.java> | + | <code java BitOperatorsDemo.java> |
class BitOperatorsDemo { | class BitOperatorsDemo { | ||
- | | + | |
- | int bitmask = 0x000F; | + | int bitmask = 0x000F; |
- | int val = 0x2222; | + | int val = 0x4444; |
- | // prints | + | |
- | System.out.println(" | + | |
- | System.out.println(" | + | System.out.println(" |
- | System.out.println(" | + | val = val & bitmask; |
- | System.out.println(" | + | // prints 16 |
- | } | + | |
+ | // prints 2 | ||
+ | | ||
+ | // prints 24 | ||
+ | | ||
+ | } | ||
} | } | ||
</ | </ | ||
- | |||
===== Τελεστές Ανάθεσης ===== | ===== Τελεστές Ανάθεσης ===== | ||
java/operators.1614529775.txt.gz · Last modified: 2021/02/28 16:29 (external edit)