Q. What is the output of System.out.println(‘A’ + 1);?

A
A1
B
66
C
65
D
B
Solution:

‘A’ has ASCII value 65, and 65 + 1 = 66, printed as a number since no string concatenation occurs.

Entri Contact Image

Get Expert Advice for Free: Register for Your Free Consultation Now!