Jump to content
  • Advertisement

Archived

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

brunogmd

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

This topic is 5153 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
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!