Java: Unicode Character Escape Syntax
Unicode Character Escape Syntax
Any character in source code can also be represented by its Unicode codepoint. By starting with \u
followed by its 4 digits hexadecimal code.
class X2 \u007b static \u0069nt \u03b1 = 3; public static void main(String[] arg) { System.out.println( \u03b1 ); } }
In the above example,
\u007b
is the left curly bracket {\u0069
is lowercase i\u3b1
is the Greek α
To find Unicode character and its codepoint and hexadecimal, see Unicode Search 😄