Post

🌒 Eclipse Java IDE
🌒 Eclipse Java IDE@EclipseJavaIDE·
Does this work? If so, what's the output? (no cheating ;)
🌒 Eclipse Java IDE tweet media
English
35
23
134
0
Simon Taddiken
Simon Taddiken@ProjectPolly·
@EclipseJavaIDE I suspect its "N", because the result of the addition of the 2 byte values might be broadened to int
English
1
0
6
0
Eazy🐝 20.10.20
Eazy🐝 20.10.20@OfficialBeeTech·
@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
0
0
3
0
Max
Max@ukalto·
@EclipseJavaIDE The Output Should Be „B“ because I think Byte+Byte Is Byte and does Not count as a Number
English
0
0
1
0
Giovanni
Giovanni@giovanni_n4·
@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
0
0
0
0
Surendra Kumar S
Surendra Kumar S@suren_kumar_S·
@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
0
0
0
0
Seruphenthalys
Seruphenthalys@Telgemannen·
@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
0
0
0
0
Paylaş