• Advertisement

Archived

This topic is now archived and is closed to further replies.

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

This topic is 4974 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I want to know how can I convert an Integer number to a String object. plz give me an example THANKS

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites

  • Advertisement