You got error on line 3 because you are trying to invoke a constructor that takes an int, 4 is an int, and you only have a constructor that takes a byte so you need to cast 4 to byte, replace line 3 with:
As a general note, when you post a question about a compiler, error, it is of GREAT help to people reading your post if you post the actual compiler error. cut'n'past the whole thing - they're not that big, we can afford the storage space.
Seriously, it does help a lot - it saves other from copying your code into an editor, saving it, and compiling it themselves.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
But I still am not convinced, there is another rule that I read somewhere that says you dont need to cast an integer in the range -128 to 127. any integer in this range is automatically cast to a byte. so then why does it require casting here. ?