Java (Integer --->to---->String)
Hi
I want to know how can I convert an Integer number to a String object. plz give me an example
THANKS
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=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!
In JAVA API documentation for J2SDK 1.4.2 on the page:
docs\api\java\lang\Integer.html
Read the docs next time!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement