How to print pi or half sign or symbol in java ?

Dear Friends,
              I am creating an application in which i want to print some symbols or special character through input and output streams.Please help...

Thanks
sgupta2000Asked:
Who is Participating?
 
kotanConnect With a Mentor Commented:
You should use unicode character set,
Every unicode prefix by \u

For example:

\u00bd  is half sign
\u001c  is pi.

All the code can find in
http://www.pccl.demon.co.uk/java/unicode.html

To print unicode char in file,

java.io.FileWriter fw = new java.io.FileWriter("filename");
fw.write("\u00a2");
fw.close();
0
 
skyjamzCommented:
beside printing special character, could u tell me how to print an ordinary character :) . thank u.

regards,
sky.
0
 
kotanCommented:
fw.write("abc\u00a2def");

This will print out abc"half sign"def

abc is ordinary character.

Is it what you want skyjamz
0
 
skyjamzCommented:
thanx,
sky
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.