I used Netbeans IDE to compile and run the below program.
public class Unicode {
public static void main(String[] args) {
char a=3476;
System.out.println(a);
}
}
But the output was a box. When I ran the program on the console, it printed a question mark. How can I fix the issue?
You can’t display a Unicode character on the Windows console directly from Java because it always writes to the console using the application code page (ANSI). However you could use JNA APIs to write unicode characters to the console directly. You would still need to install a monospace font that includes a glyph for the character that you’re trying to display.