Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JAVA IO - How to write data (double, float) to a text file

843811Dec 30 2001 — edited Dec 31 2001
I am writing an application that after it runs it writes some results to a log file. It needs to write values of data type double and float to this log file. The log file needs to be in a human-readable text form not in an internal binary format. How do I do this?

I tried connecting an OutputStreamWriter with a FileWriter, but it sure didn't work.

osw = new OutputStreamWriter(new FileWriter("test2.txt"));

Any help would be appreciated.

Thanks

Alex
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 28 2002
Added on Dec 30 2001
2 comments
728 views