Easy Tutorial
For Competitive Exams

What is the output of this program?
class mainclass {
public static void main(String args[])
{
char a = A;
a++;
System.out.print((int)a);
}
}

66
67
65
64
Explanation:

ASCII value of ‘A’ is 65, on using ++ operator character value increments by one.
output:
$ javac mainclass.java
$ java mainclass
66
Share with Friends
Privacy Copyright Contact Us