Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing Sigma Symbol in Java

How do I display "Σ" using a System.out.println(); statement...??

P.S.: Using Eclipse IDE

like image 350
codemaniac Avatar asked Dec 29 '22 01:12

codemaniac


1 Answers

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.

like image 118
JB Nizet Avatar answered Dec 31 '22 11:12

JB Nizet