Can anyone explain why the following doesn't compile?
byte b = 255 << 1
The error:
Constant value '510' cannot be converted to a 'byte'
I'm expecting the following in binary:
1111 1110
The type conversion has stumped me.
Can anyone explain why the following doesn't compile?
byte b = 255 << 1
The error:
Constant value '510' cannot be converted to a 'byte'
I'm expecting the following in binary:
1111 1110
The type conversion has stumped me.
And since << has a higher precedence than & you can save the brackets: