Q. What is the output of System.out.println(‘a’ + ‘b’ + ‘c’);?

A
abc
B
294
C
6
D
error
Solution:

Char values are added as ASCII values: 97 + 98 + 99 = 294, since no string is involved initially.

Entri Contact Image

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