Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trunning an integer to a String

 
ione walker
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
========================
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String s = Integer.toString(42);
 
Richard Boren
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OR
String s = String.valueOf( printNum ) ;
 
ione walker
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you!
That is just what I wanted.
Originally posted by Richard Boren:
OR
String s = String.valueOf( printNum ) ;


------------------
=======================
Ione Walker
walkeri@uas.net
========================
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic