Post

@EclipseJavaIDE I suspect its "N", because the result of the addition of the 2 byte values might be broadened to int
English

@EclipseJavaIDE I think it's B. Byte plus byte should have type byte.
Wicklow, Ireland 🇮🇪 English

@EclipseJavaIDE Answer is B
Explanation: Data type Casting has highest priority
Integer 3 and 5 are first converted to datatype Byte before adding them.
Therefore the x(Byte i) is called because the argument passed is of Byte data type
English

@EclipseJavaIDE The Output Should Be „B“ because I think Byte+Byte Is Byte and does Not count as a Number
English

@EclipseJavaIDE I guess it's B. Summing up two bytes will result in a byte.
English

@EclipseJavaIDE Put instead of Number, it works too
public static void x(Serializable n) {
System.out.println("n");
}
English

@EclipseJavaIDE The arithmetic operations of bytes result in an integer .. and in this case 'int' autoboxed to 'Integer' which is a child of Number .. so x(Number ) is called.
and the output is N
btw ... one should avoid such overloading of methods
English

@EclipseJavaIDE @java yes, It prints "N". If there is no addition of typecast byte numbers i.e., x((byte)3), then it will print "I".
English

@EclipseJavaIDE @java If I remember correctly, you cannot perform mathematical operations on bytes, so they're converted to ints and then summarized. So N. But that could be c#
English





















