About 51 results
Open links in new tab
  1. Java - Convert integer to string - Stack Overflow

    Returns a String object representing the specified integer. The argument is converted to signed decimal representation and returned as a string, exactly as if the argument and radix 10 were …

  2. How do I convert a String to an int in Java? - Stack Overflow

    Alternatively, you can use an Ints method from the Guava library, which in combination with Java 8's Optional, makes for a powerful and concise way to convert a string into an int:

  3. java - How do I convert from int to String? - Stack Overflow

    Nov 5, 2010 · If you say ""+i, Java creates a StringBuilder object, appends an empty string to it, converts the integer to a string, appends this to the StringBuilder, then converts the …

  4. What is the most efficient way to convert an int to a String?

    May 31, 2017 · The third solution is out of the question, since it implicitly creates a StringBuilder and appends the components (in this case, the number and the empty string) to that, and …

  5. What is the best way to convert any primitive data type to string

    The main adavantage is that there is a String.valueOf method for boolean, char, int, long, float, double and Object, so the same method name can be used to convert anything to a String.

  6. Converting an int to a binary string representation in Java?

    Mar 9, 2010 · What would be the best way (ideally, simplest) to convert an int to a binary string representation in Java? For example, say the int is 156. The binary string representation of …

  7. java - Converting an int array to a String array - Stack Overflow

    Sep 1, 2010 · Why don't you simply cast those values to String within the original for loop, creating a String array rather than an int array? Assuming that you're gathering your initial …

  8. How to convert an int array to String with toString method in Java

    Jun 6, 2012 · Returns a string representation of the contents of the specified array. The string representation consists of a list of the array's elements, enclosed in square brackets ("[]"). …

  9. Java converting int to hex and back again - Stack Overflow

    Aug 17, 2012 · Java's parseInt method is actally a bunch of code eating "false" hex : if you want to translate -32768, you should convert the absolute value into hex, then prepend the string with '-'.

  10. Java - Change int to ascii - Stack Overflow

    Mar 16, 2011 · In Java, you really want to use Integer.toString to convert an integer to its corresponding String value. If you are dealing with just the digits 0-9, then you could use …