About 735,000 results
Open links in new tab
  1. 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:

  2. Java - Convert integer to string - Stack Overflow

    int i = 1234; String str = Integer.toString(i); Returns a String object representing the specified integer. The argument is converted to signed decimal representation and returned as a string, exactly as if …

  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 StringBuilder to a String.

  4. Most efficient way of converting String to Integer in java

    Jun 23, 2009 · Note: Java 6u14 allows you to increase the size of your Integer pool with a command line option -Djava.lang.Integer.IntegerCache.high=1024 for example. Note 2: If you are reading raw data …

  5. ¿Cómo convertir un String en Int en Java? [duplicada]

    ¿Cómo convertir un String en Int en Java? [duplicada] Formulada hace 8 años y 7 meses Modificada hace 8 años y 7 meses Vista 216k veces

  6. java - What is the most efficient way to convert an int to a String ...

    May 31, 2017 · The first two examples are actually identical, since String.valueOf (int) uses the Integer.toString (int) method. The third is ugly, and probably less efficient since concatenation is slow …

  7. What's the best way to check if a String represents an integer in Java ...

    May 7, 2015 · If you are concerned whether you can actually parse the string into an int or long you would also need to check if the integer the string represents actually fits into those data types.

  8. How to concatenate int values in java? - Stack Overflow

    Apr 20, 2010 · I have the following values: int a=1; int b=0; int c=2; int d=2; int e=1; How do i concatenate these values so that i end up with a String that is 10221; please note that multiplying a …

  9. java - int型の値を文字列として連結したい - スタック・オーバーフロー

    Oct 4, 2020 · 仕様は次のリンクの通りになります。 15.18.1. String Concatenation Operator + 簡単に言うと、 x + y の x か y の一方が String の場合、 + は特別な挙動となり、他方を文字列変換した上 …

  10. java - How can I pad an integer with zeros on the left? - Stack Overflow

    How do you left pad an int with zeros when converting to a String in java? I'm basically looking to pad out integers up to 9999 with leading zeros (e.g. 1 = 0001).