- 1

Challenge question

what is the output of this code? char b = 'a' + 2; System.out.print (b);

26th Apr 2017, 9:38 PM
Edward
4 Answers
+ 25
c 'a'+2 increases a's ASCII value by 2 and assigns the equivalent character to b.
26th Apr 2017, 9:41 PM
Shamima Yasmin
Shamima Yasmin - avatar
26th Apr 2017, 9:43 PM
Rrestoring faith
Rrestoring faith - avatar
+ 8
If error is an option just be sure there isn't anything missing: semi-colon, ', caps etc..
26th Apr 2017, 9:54 PM
Rrestoring faith
Rrestoring faith - avatar
+ 2
ok i was just making sure. cause the only options were 1 3 a2 error and i knew it wasnt any of them. i guess its just another wrong question
26th Apr 2017, 9:47 PM
Edward