java - I can't figure out why DrJava won't output Unicode symbols -


i'd apologize upfront incredible newb-ness regard java , programming in general. i've searched everywhere answer , can't seem find one.

so i'm trying run following:

public class writesquares2 {   public static void main(string[] args)   {     (int i=1; i<=10; i++)     {       system.out.println(i + " \u2261 " + (i % 7) + " modulo 7");     }   } } 

the unicode character \u2261 congruence sign (≡). drjava shows following output:

1 ? 1 modulo 7 2 ? 2 modulo 7 3 ? 3 modulo 7 4 ? 4 modulo 7 5 ? 5 modulo 7 6 ? 6 modulo 7 7 ? 0 modulo 7 8 ? 1 modulo 7 9 ? 2 modulo 7 10 ? 3 modulo 7 

what's weirdest when type

'\u2261' 

into interactions box, equivalence character in single quotes:

'≡' 

i've tried putting '\u2261' in code instead of " \u2261 ", stuff this:

8803 modulo 7 8805 modulo 7 8807 modulo 7 

i tried inserting unicode character code, gave error message. can figure out what's going on or i'm doing wrong? appreciated.

[i should add isn't homework assignment or anything, our book barely mentions unicode - trying figure out ... , when started, didn't think hard!]

edit: i'm using mac os 10.7.5 , dr java says build "drjava-20120818-r5686".

edit #2: here's screenshot using monospaced 12 main font. still shows question marks, though can console return me symbol if type in directly, single quotes.

enter image description here

the issue has font you're using, not problem code. see drjava's settings under edit > preferences > display options > fonts > main font.

drjava using default font (monospaced 12) on linux: drjava on linux "main font" set default (monospaced 12)

drjava using different font (pt sans 12) on linux: drjava on linux "main font" set "pt sans 12"

both screenshots same instance of drjava; didn't have shut down. note in interactions pane, glyph correct monospaced font , generic placeholder pt sans. same occurs in console tab (not shown).


Comments

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -