开发者

Printing Sigma Symbol in Java

开发者 https://www.devze.com 2023-02-10 03:57 出处:网络
How do I display \"Σ\" using a System.out.println(); statement.开发者_如何学运维..?? P.S.: Using Eclipse IDEAccording to http://www.fileformat.info/info/unicode/char/3a3/index.htm, the unicode value

How do I display "Σ" using a System.out.println(); statement.开发者_如何学运维..??

P.S.: Using Eclipse IDE


According to http://www.fileformat.info/info/unicode/char/3a3/index.htm, the unicode value for this symbol is U+03A3, so you just have to use the unicade escape sequence :

System.out.println("\u03A3");

The problem, now, is that the console where the String is printed must support unicode and use a font where this symbol is supported, else you'll probably see a '?' character instead of the sigma.

0

精彩评论

暂无评论...
验证码 换一张
取 消