< prev index next >

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

Print this page




 102      */
 103     public byte byteValue() {
 104         return (byte)intValue();
 105     }
 106 
 107     /**
 108      * Returns the value of the specified number as a {@code short}.
 109      *
 110      * <p>This implementation returns the result of {@link #intValue} cast
 111      * to a {@code short}.
 112      *
 113      * @return  the numeric value represented by this object after conversion
 114      *          to type {@code short}.
 115      * @since   1.1
 116      */
 117     public short shortValue() {
 118         return (short)intValue();
 119     }
 120 
 121     /** use serialVersionUID from JDK 1.0.2 for interoperability */

 122     private static final long serialVersionUID = -8742448824652078965L;
 123 }


 102      */
 103     public byte byteValue() {
 104         return (byte)intValue();
 105     }
 106 
 107     /**
 108      * Returns the value of the specified number as a {@code short}.
 109      *
 110      * <p>This implementation returns the result of {@link #intValue} cast
 111      * to a {@code short}.
 112      *
 113      * @return  the numeric value represented by this object after conversion
 114      *          to type {@code short}.
 115      * @since   1.1
 116      */
 117     public short shortValue() {
 118         return (short)intValue();
 119     }
 120 
 121     /** use serialVersionUID from JDK 1.0.2 for interoperability */
 122     @java.io.Serial
 123     private static final long serialVersionUID = -8742448824652078965L;
 124 }
< prev index next >