Reason:
My java file is saved in UTF-8 encoding, while javac is compiled in computer system encoding (GBK, I It is handled by win 7 system).
Solution:
Method 1. Store the java file in GBK encoding, then compile and run it;
Method 2 , specify encoding as UTF-8 when compiling, compile command.
Compilation command (the file name depends on the actual situation):
Recommended tutorial:java quick getting Started
The above is the detailed content of Garbled characters are output in the java output statement. For more information, please follow other related articles on the PHP Chinese website!