< prev index next >
src/java.base/share/classes/java/lang/Boolean.java
Print this page
@@ -81,13 +81,15 @@
*
* <p><b>Note: It is rarely appropriate to use this constructor.
* Unless a <i>new</i> instance is required, the static factory
* {@link #valueOf(boolean)} is generally a better choice. It is
* likely to yield significantly better space and time performance.</b>
+ * @deprecated use {@link #valueOf(boolean)} instead.
*
* @param value the value of the {@code Boolean}.
*/
+ @Deprecated
public Boolean(boolean value) {
this.value = value;
}
/**
@@ -98,13 +100,15 @@
* value {@code false}. Examples:<p>
* {@code new Boolean("True")} produces a {@code Boolean} object
* that represents {@code true}.<br>
* {@code new Boolean("yes")} produces a {@code Boolean} object
* that represents {@code false}.
+ * @deprecated use {@link #valueOf(String)} instead.
*
* @param s the string to be converted to a {@code Boolean}.
*/
+ @Deprecated
public Boolean(String s) {
this(parseBoolean(s));
}
/**
< prev index next >