Why does this code block return false...
char ra1= '\u30E9';
char ra2= '\u30E9';
Character RA1= ra1;
Character RA2= ra2;
System.out.println("Does Character RA1 == Character RA2? " + (RA1 == RA2)); //returns false
...when this code block returns true?
char a1= 'a';
char a2= 'a';
Character A1= a1;
Character A2= a2;
System.out.println("Does Character A1 == Character A2? " + (A1 == A2)); //returns true
They seem like they're doing the same thing to me, and both Characters
hold the same char
value so I don't understand why ==
returns false
for one and true
for the other