< prev index next >

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

Print this page

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

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

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