aspose file tools*
The moose likes Beginning Java and the fly likes Trunning an integer to a String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trunning an integer to a String" Watch "Trunning an integer to a String" New topic
Author

Trunning an integer to a String

ione walker
Ranch Hand

Joined: Apr 19, 2001
Posts: 31
Hi,
I am pulling my hair out!!!
I am trying to take a interger I have (printNum)
& convert it to a String.
When I tried to do
String s = new String(printNum);
I get the follwing error
cannot resolve symbol
symbol : constructor String (int)
location: class java.lang.String
I know that there is a way to do this &
would have sworn that this was it......
BUT as reality is getting in my way.
Help

------------------
=======================
Ione Walker
walkeri@uas.net
========================


=======================<BR>Ione Walker<BR>walkeri@usa.net<BR>========================
Michael Hildner
Ranch Hand

Joined: Oct 13, 2000
Posts: 297
String s = Integer.toString(42);
Richard Boren
Ranch Hand

Joined: Mar 01, 2001
Posts: 233
OR
String s = String.valueOf( printNum ) ;
ione walker
Ranch Hand

Joined: Apr 19, 2001
Posts: 31
Thank you!
That is just what I wanted.
Originally posted by Richard Boren:
OR
String s = String.valueOf( printNum ) ;


------------------
=======================
Ione Walker
walkeri@uas.net
========================
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trunning an integer to a String
 
Similar Threads
confused 'bout construcor
printing threads to a text area
inhertiance question
Could some one explain whats happening here.
using thread class to print to a text area