Integer.valueOf

Returns an {@code Integer} instance representing the specified {@code int} value. If a new {@code Integer} instance is not required, this method should generally be used in preference to the constructor {@link #Integer(int)}, as this method is likely to yield significantly better space and time performance by caching frequently requested values.

This method will always cache values in the range -128 to 127, inclusive, and may cache other values outside of this range.

@param i an {@code int} value. @return an {@code Integer} instance representing {@code i}.

  1. Integer valueOf(int i)
    class Integer
    static
    valueOf
    (
    int i
    )
  2. Integer valueOf(string s, int radix)
  3. Integer valueOf(string s)

Meta