When you apply mathematical operations on byte, they will always result in int. To protect from overflow it will not allow you to store an int into a byte.
That is the
reason you are getting the error as "possible loss pf precision".
Change the code like this and it will work,
Class ByteTest {
public static void main(
String[] args) {
int b = 100;
Only change is byte to int.
Good that you posted in Javaranch. All the best...
Sreedhar S
Java developer