For Programmers: Free Programming Magazines  


Home > Archive > Java Help > September 2004 > Simple type conversion question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Simple type conversion question
Dfenestr8

2004-09-28, 9:28 pm

How do I convert a sequence of variables of type int to a String?



Bryce

2004-09-28, 9:28 pm

On Wed, 29 Sep 2004 05:24:00 +0900, Dfenestr8
<chrisdewinN0SPAM@yahoo.com.au> wrote:

>How do I convert a sequence of variables of type int to a String?

http://java.sun.com/j2se/1.4.2/docs...ng.html#valueOf(int)

String intString = String.valueOf(intValue);

--
now with more cowbell
Tony Morris

2004-09-28, 9:28 pm

You don't "convert a sequence of variables of type int to a String" without
providing proper context.

Since you didn't state your problem clearly, assumptions must be made.
You're reading off a java.io.InputStream using the read() method and wish to
convert the raw data to a String.
You do this by using a java.io.InputStreamReader to convert the raw data to
character data.
Then you might consider writing the character data to a java.io.StringWriter
or a java.lang.StringBuffer.

If this assumption is incorrect, state your problem clearly.

--
Tony Morris
http://xdweb.net/~dibblego/


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com