• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Trunning an integer to a String

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
========================
 
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
String s = Integer.toString(42);
 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OR
String s = String.valueOf( printNum ) ;
 
ione walker
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
========================
 
reply
    Bookmark Topic Watch Topic
  • New Topic