35

To convert an int number to a string I do this:-

String s=10+"";

Comments
  • 11
  • 1
    String.valueOf(...);
    ftw
  • 1
    And to convert it back you can just subtract it back:

    char c;
    int num = c-'0';

    JK, this is in C.
  • 0
    NOOOO
    "" + number
    Please.
  • 2
    This is wrong! Go to a corner, look to the floor and feel the guilt! When you feel the pain in all of your dev-bones, go through a spiritual cleaning ritual, something klingon maybe.
  • 0
    What our Java prof used to do back in college!
Add Comment