In Java we can do
byte b = 5;
But why can\'t we pass same argument to a function which accepts byte
byte
myObj
You must cast your argument 5 to type byte in your method testByte. Java looks specifically at the argument type.
5
testByte
Change it to:
myObject.testByte( (byte) 5);