-1

Is there a shorter hand way (more space savy) way to compact a toString than this?

int number = 20;
String numberChange = Integer.toString(number);
Stefano Sanfilippo
  • 32,265
  • 7
  • 79
  • 80
Icewine
  • 1,851
  • 1
  • 12
  • 22
  • http://stackoverflow.com/questions/4105331/how-to-convert-from-int-to-string – jlars62 Jun 20 '14 at 00:04
  • 2
    What do you mean by "space savy [sic]"? If you would like your source file to use 13 fewer bytes on your 750GB hard drive, then the answers will help you do that. – ajb Jun 20 '14 at 00:09

1 Answers1

0

Java will convert things to string when adding something to a string.

String numberChange = ""+number;
ug_
  • 11,267
  • 2
  • 35
  • 52