3 Replies - 1858 Views - Last Post: 13 April 2009 - 06:51 PM Rate Topic: -----

#1 undergroundthry  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 31
  • Joined: 24-June 08

Java io.PrintStream, text.DecimalFormat

Posted 13 April 2009 - 06:37 PM

Can anybody tell me what java.io.PrintStream and java.text.DecimalFormat do and how would you use it?
Is This A Good Question/Topic? 0
  • +

Replies To: Java io.PrintStream, text.DecimalFormat

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8327
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Java io.PrintStream, text.DecimalFormat

Posted 13 April 2009 - 06:40 PM

View Postundergroundthry, on 13 Apr, 2009 - 05:37 PM, said:

Can anybody tell me what java.io.PrintStream and java.text.DecimalFormat do and how would you use it?

java.text.DecimalFormat is to format data into a String
java.io.PrintStream is to write that String to file
Was This Post Helpful? 0
  • +
  • -

#3 undergroundthry  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 31
  • Joined: 24-June 08

Re: Java io.PrintStream, text.DecimalFormat

Posted 13 April 2009 - 06:43 PM

View Postpbl, on 13 Apr, 2009 - 05:40 PM, said:

View Postundergroundthry, on 13 Apr, 2009 - 05:37 PM, said:

Can anybody tell me what java.io.PrintStream and java.text.DecimalFormat do and how would you use it?

java.text.DecimalFormat is to format data into a String
java.io.PrintStream is to write that String to file


So text.DecimalFormat basically cuts down on the time needed to convert a double, int, etc. to a string?

I'm still not sure what printstream does. It converts a string to a file? Where is this file or better yet what is this file?
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8327
  • View blog
  • Posts: 31,857
  • Joined: 06-March 08

Re: Java io.PrintStream, text.DecimalFormat

Posted 13 April 2009 - 06:51 PM

View Postundergroundthry, on 13 Apr, 2009 - 05:43 PM, said:

So text.DecimalFormat basically cuts down on the time needed to convert a double, int, etc. to a string?

cuts down on time needed... never said that. May be you can do it faster if you want to re-invent the wheel.
It is just Java library stuff to help you format the way you want (number of decimals and thinks like that) double, int, float,...

View Postundergroundthry, on 13 Apr, 2009 - 05:43 PM, said:

I'm still not sure what printstream does. It converts a string to a file? Where is this file or better yet what is this file?

It writes a String to a file or a double or a float or a boolean calling may be the previous one (with default options) if you are not writting a String
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1