Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int bitNumber = b-(8*byteIndex);
- bitMask = 0x8>>(byte)bitNumber;
- error: possible loss of precision
- int bitNumber = b-(8*byteIndex);
- bitMask = 0x8>>2;
- 48) int byteIndex;
- 49) byte bitMask;
- 50) int bitNumber;
- // assign value to byteIndex
- 67) bitNumber = b-(8*byteIndex);
- 68) bitMask = 0x8>>bitNumber;
- ...MyClass.java:68: error: possible loss of precision
- bitMask = 0x8>>bitNumber;
- ^
- required: byte
- found: int
- 1 error
- byte bitMask = (byte)(0x8>>(byte)bitNumber);
- byte bitMask = (byte)(0x8>>bitNumber);
- byte bitMask;
- int varInt1 = 3;
- final int finalVarInt2 = 3;
- final int finalVarInt3 = 4;
- bitMask = 0x8>>varInt1; // 1. Will not work.
- bitMask = 0x8<<3; // 2. Will work
- bitMask = 0x8<<4; // 3. Will not work
- bitMask = 0x8<<finalVarInt2; // 1. Will work
- bitMask = 0x8<<finalVarInt3; // 2. Will not work
Add Comment
Please, Sign In to add comment