Post

BiggB
BiggB@bigbindian·
@EclipseJavaIDE Before calling method, char a and z are added and the result, which is integer, is passed. Outcome should be Z
English
0
0
2
0
Manish Kumar
Manish Kumar@manish18383·
@EclipseJavaIDE '+' operation would be performed on ASCII values of 'a' and 'z'. It will be 97+122=219. So depending on int 219 function hello(int i) would be invoked and consequently Z printed.
English
0
0
0
0
Giovanni
Giovanni@giovanni_n4·
@EclipseJavaIDE Arithmetic ops involving char, byte, short will be elevated to int so help(int) is called with output 'Z'
English
0
0
0
0
Tristan Mahinay
Tristan Mahinay@rjtmahinay·
@EclipseJavaIDE Answer: Z, a two primitive char when use arithmetically, the result will be primitive int.
English
0
0
0
0
Scott Selikoff
Scott Selikoff@ScottSelikoff·
@EclipseJavaIDE I know this but I also wrote a chapter about operator precedence and casting so... I may have cheated 🤣
English
0
0
0
0
Puneet Sapaliga പുനീത് സപലിഗ
@EclipseJavaIDE -hello( char bi) method accepts single parameter of type Char -hello(int i) accepts single param type int hello('a' + 'z') -no single argument is passed to the method -two arguments passed to this method are evaluated as the sum of the ASCII values (int) of chars a & z Ans:Z
English
0
0
0
0
Paylaş