1104 * Constructs a newly allocated {@code Integer} object that |
1104 * Constructs a newly allocated {@code Integer} object that |
1105 * represents the specified {@code int} value. |
1105 * represents the specified {@code int} value. |
1106 * |
1106 * |
1107 * @param value the value to be represented by the |
1107 * @param value the value to be represented by the |
1108 * {@code Integer} object. |
1108 * {@code Integer} object. |
1109 */ |
1109 * |
|
1110 * @deprecated |
|
1111 * It is rarely appropriate to use this constructor. The static factory |
|
1112 * {@link #valueOf(int)} is generally a better choice, as it is |
|
1113 * likely to yield significantly better space and time performance. |
|
1114 */ |
|
1115 @Deprecated(since="9") |
1110 public Integer(int value) { |
1116 public Integer(int value) { |
1111 this.value = value; |
1117 this.value = value; |
1112 } |
1118 } |
1113 |
1119 |
1114 /** |
1120 /** |
1116 * represents the {@code int} value indicated by the |
1122 * represents the {@code int} value indicated by the |
1117 * {@code String} parameter. The string is converted to an |
1123 * {@code String} parameter. The string is converted to an |
1118 * {@code int} value in exactly the manner used by the |
1124 * {@code int} value in exactly the manner used by the |
1119 * {@code parseInt} method for radix 10. |
1125 * {@code parseInt} method for radix 10. |
1120 * |
1126 * |
1121 * @param s the {@code String} to be converted to an |
1127 * @param s the {@code String} to be converted to an {@code Integer}. |
1122 * {@code Integer}. |
1128 * @throws NumberFormatException if the {@code String} does not |
1123 * @exception NumberFormatException if the {@code String} does not |
1129 * contain a parsable integer. |
1124 * contain a parsable integer. |
1130 * |
1125 * @see java.lang.Integer#parseInt(java.lang.String, int) |
1131 * @deprecated |
1126 */ |
1132 * It is rarely appropriate to use this constructor. |
|
1133 * Use {@link #parseInt(String)} to convert a string to a |
|
1134 * {@code int} primitive, or use {@link #valueOf(String)} |
|
1135 * to convert a string to an {@code Integer} object. |
|
1136 */ |
|
1137 @Deprecated(since="9") |
1127 public Integer(String s) throws NumberFormatException { |
1138 public Integer(String s) throws NumberFormatException { |
1128 this.value = parseInt(s, 10); |
1139 this.value = parseInt(s, 10); |
1129 } |
1140 } |
1130 |
1141 |
1131 /** |
1142 /** |