Re: Why can't a byte hold 1?
You know that i has the value 1 and a 1 fits in a byte, and I know that, but the compiler doesn't know that; it is very near sighted, i.e. all it sees that you want to assign an int to a byte and that doesn't fit so it starts whining about it. Change the second line to:
and the compiler assumes that you know what you're doing. If you had assigned a literal value to byte b and that value fits in a byte [-128 ... 127] the compiler accepts the assignment.