It works because s is a final variable which is initialized at the point of declaration, which makes it a compile time constant. Since its value is also in the representable range for the byte type, the assignment of s to b is correct.
All code in my posts, unless a source is explicitly mentioned, is my own.
You're welcome, Avi. Perhaps it might be a little soon in your progress, but once you are more comfortable, you might want to download the free JLS (Java Language Specification) pdf from Sun. It has information about all these things, and I find it to be very helpful. As is this forum.
All code in my posts, unless a source is explicitly mentioned, is my own.
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
a bit of art, as a gift, the permaculture playing cards