If the assignment command use a constant expression with a value of type int, falling within the range of byte, the compiler automatically narrows its type. That is why the byte b = 8; command compiles without errors.
In other cases, for example during the method call, this will not occur. Therefore, to the command m(7); compiler error is generated.
Login in to like
Login in to comment