开发者

Printing Sigma Symbol in Java

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜