Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to insert the ≠ sign into a string

What I want as an end result is this

System.out.println("This is the not equal to sign\n≠");

to appear (when run) as

This is the not equal to sign
≠

not to appear as

This is the not equal to sign
?

Is there any way to do this? I tried using windows character map, copied the symbol here, and in my code, but after changing encoding to UTF-8 and inserting it, it comes up as ? when run...
What can be done? Thanks in advance for answers to this utterly simple question

like image 521
Kyle Avatar asked Apr 01 '14 17:04

Kyle


1 Answers

Set character encoding to UTF-8, pass this vm argument, if your text editor already uses UTF-8 or supports this character

-Dfile.encoding=UTF-8
like image 120
jmj Avatar answered Nov 07 '22 13:11

jmj