A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
Integer Conversion
Natalia Helwig
Greenhorn
Joined: Jun 05, 2001
Posts: 1
posted
Jun 05, 2001 17:45:00
0
Question:
How do I easily convert an integer into a
string
???
Cindy Glass
"The Hood"
Sheriff
Joined: Sep 29, 2000
Posts: 8521
posted
Jun 05, 2001 18:36:00
0
int i = 3;
String s = String.valueOf(i);
"JavaRanch, where the deer and the Certified play" - David O'Meara
Sayed Ibrahim Hashimi
Ranch Hand
Joined: May 17, 2001
Posts: 148
posted
Jun 06, 2001 08:47:00
0
Hi, you can also use:
int i = 50; String str = Integer.toString(i);
Originally posted by Natalia Helwig:
Question:
How do I easily convert an integer into a string???
SCJP 1.4<br /><a href="http://www.cise.ufl.edu/~sih" target="_blank" rel="nofollow">www.cise.ufl.edu/~sih</a>
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: Integer Conversion
Similar Threads
Class Cast Exception while reading the int value from a session object
Adding primitives to Lists
SQL Query
are these one and the same
Integer...
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter