< prev index next >

src/java.base/share/classes/java/lang/Short.java

Print this page

 42  * The {@code Short} class wraps a value of primitive type {@code
 43  * short} in an object.  An object of type {@code Short} contains a
 44  * single field whose type is {@code short}.
 45  *
 46  * <p>In addition, this class provides several methods for converting
 47  * a {@code short} to a {@code String} and a {@code String} to a
 48  * {@code short}, as well as other constants and methods useful when
 49  * dealing with a {@code short}.
 50  *
 51  * <p>This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
 52  * class; programmers should treat instances that are
 53  * {@linkplain #equals(Object) equal} as interchangeable and should not
 54  * use instances for synchronization, or unpredictable behavior may
 55  * occur. For example, in a future release, synchronization may fail.
 56  *
 57  * @author  Nakul Saraiya
 58  * @author  Joseph D. Darcy
 59  * @see     java.lang.Number
 60  * @since   1.1
 61  */

 62 @jdk.internal.ValueBased
 63 public final class Short extends Number implements Comparable<Short>, Constable {
 64 
 65     /**
 66      * A constant holding the minimum value a {@code short} can
 67      * have, -2<sup>15</sup>.
 68      */
 69     public static final short   MIN_VALUE = -32768;
 70 
 71     /**
 72      * A constant holding the maximum value a {@code short} can
 73      * have, 2<sup>15</sup>-1.
 74      */
 75     public static final short   MAX_VALUE = 32767;
 76 
 77     /**
 78      * The {@code Class} instance representing the primitive type
 79      * {@code short}.
 80      */
 81     @SuppressWarnings("unchecked")

 42  * The {@code Short} class wraps a value of primitive type {@code
 43  * short} in an object.  An object of type {@code Short} contains a
 44  * single field whose type is {@code short}.
 45  *
 46  * <p>In addition, this class provides several methods for converting
 47  * a {@code short} to a {@code String} and a {@code String} to a
 48  * {@code short}, as well as other constants and methods useful when
 49  * dealing with a {@code short}.
 50  *
 51  * <p>This is a <a href="{@docRoot}/java.base/java/lang/doc-files/ValueBased.html">value-based</a>
 52  * class; programmers should treat instances that are
 53  * {@linkplain #equals(Object) equal} as interchangeable and should not
 54  * use instances for synchronization, or unpredictable behavior may
 55  * occur. For example, in a future release, synchronization may fail.
 56  *
 57  * @author  Nakul Saraiya
 58  * @author  Joseph D. Darcy
 59  * @see     java.lang.Number
 60  * @since   1.1
 61  */
 62 @jdk.internal.MigratedValueClass
 63 @jdk.internal.ValueBased
 64 public final class Short extends Number implements Comparable<Short>, Constable {
 65 
 66     /**
 67      * A constant holding the minimum value a {@code short} can
 68      * have, -2<sup>15</sup>.
 69      */
 70     public static final short   MIN_VALUE = -32768;
 71 
 72     /**
 73      * A constant holding the maximum value a {@code short} can
 74      * have, 2<sup>15</sup>-1.
 75      */
 76     public static final short   MAX_VALUE = 32767;
 77 
 78     /**
 79      * The {@code Class} instance representing the primitive type
 80      * {@code short}.
 81      */
 82     @SuppressWarnings("unchecked")
< prev index next >