Java (Integer --->to---->String)

Started by
2 comments, last by brunogmd 19 years, 10 months ago
Hi I want to know how can I convert an Integer number to a String object. plz give me an example THANKS
Bruno B
Advertisement
Integer i = new Integer(...);
...
String s=i.toString();

or, if it''s a primitive type:
int i;
...
String s = ""+i; //


Just starting Java, hem?
String s = Integer.toString( your_integer_here );

In JAVA API documentation for J2SDK 1.4.2 on the page:
docs\api\java\lang\Integer.html

Read the docs next time!
hehe..i`ll read the docs . Thanks
Bruno B

This topic is closed to new replies.

Advertisement