What will be the output of the following Java program? a) 66 b) 67 c) 65 d) 64

What will be the output of the following Java program?

class mainclass {
        public static void main(String args[]) 
        {
            char a = 'A';
            a++;
	    System.out.print((int)a);
        } 
    }

a) 66
b) 67
c) 65
d) 64

Answer: a
Explanation: ASCII value of ‘A’ is 65, on using ++ operator character value increments by one.
output:
Previous Post Next Post