Solved

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

Posted on 2001-08-29
4
726 Views
Last Modified: 2008-03-17
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
0
Comment
Question by:sgupta2000
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
kotan earned 50 total points
ID: 6435729
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
 

Expert Comment

by:skyjamz
ID: 6435730
beside printing special character, could u tell me how to print an ordinary character :) . thank u.

regards,
sky.
0
 
LVL 6

Expert Comment

by:kotan
ID: 6435766
fw.write("abc\u00a2def");

This will print out abc"half sign"def

abc is ordinary character.

Is it what you want skyjamz
0
 

Expert Comment

by:skyjamz
ID: 6439661
thanx,
sky
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
going to wrong jsp page 2 66
Problem to Alipay 10 92
How to configure empty element in XML Document parser? 15 56
Using jdbcTemplate.batchUpdate to improve INSERT performance 6 32
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

736 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question