Doubt in equality operators

	int myInt='A';
            char myChar='A';
	System.out.println(myInt == myChar);

Above code is giving output - true
I feel it should be false.
When I print System.out.println(myInt); it gives 65 and System.out.println(myChar); gives A.
So the output for System.out.println(myInt == myChar); should be false. isn’t it?
Please help me to understand.

Replace this line with your code.

<do not remove the three backticks above>

char is a numeric data type, when printed the corresponding character is shown. The ascii value for ‘A’ is 65

@ionatan : 65 is not equal to A so it should be false. am i right.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.