Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class BitwiseAnd {
- public static void main(String[] args) {
- int bitmask = 0x0000000F; //the last hex digit
- int val = 0x22222222; //4 byte value containing 101010 repeating
- System.out.println(val & bitmask); //guess what this prints
- }
- }
Add Comment
Please, Sign In to add comment