Short byteValue() method in Java with Example Last Updated : 05 Dec, 2018 Comments Improve Suggest changes Like Article Like Report The java.lang.Short.byteValue() method of Short class is a built in method in Java which is used to return the value of the Short object as a byte. Syntax ShortObject.byteValue() Return Value: It return the value of ShortObject as byte. Below is the implementation of byteValue() method in Java: Example 1: Java // Java code to demonstrate // Short byteValue() method class GFG { public static void main(String[] args) { // Short value Short a = 17; // wrapping the Short value // in the wrapper class Short Short b = new Short(a); // byteValue of the Short Object byte output = b.byteValue(); // printing the output System.out.println("Byte value of " + b + " is : " + output); } } Output: Byte value of 17 is : 17 Example 2: Java // Java code to demonstrate // Short byteValue() method class GFG { public static void main(String[] args) { String value = "17"; // wrapping the Short value // in the wrapper class Short Short b = new Short(value); // byteValue of the Short Object byte output = b.byteValue(); // printing the output System.out.println("Byte value of " + b + " is : " + output); } } Output: Byte value of 17 is : 17 Comment More infoAdvertise with us Next Article Short byteValue() method in Java with Example S Sruti Rai Follow Improve Article Tags : Java java-basics Java-lang package Java-Functions Java-Short +1 More Practice Tags : Java Similar Reads Short doubleValue() method in Java with Examples The java.lang.Short.doubleValue() method of Short class is a built in method in Java which is used to return the value of the Short object as a double. Syntax: public double doubleValue() Return type: It return the value of ShortObject as double. Below is the implementation of doubleValue() method i 2 min read Number.byteValue() Method in Java with Examples The Number class in Java is an abstract superclass for numeric wrapper classes like Integer, Float, Double, etc. One of the useful methods provided by this class is byteValue(). The Number.byteValue() method in Java is used when we want to extract the byte representation of a numeric object.The byte 3 min read Short equals() method in Java with Examples The equals() method of Short class is a built in method in Java which is used to compare the equality given Object with the instance of Short invoking the equals() method. Syntax ShortObject.equals(Object a) Parameters: It takes an Object type object a as input which is to be compared with the insta 2 min read Byte shortValue() method in Java with examples The shortValue() method of Byte class is a built in method in Java which is used to return the value of this Byte object as short. Syntax ByteObject.shortValue() Return Value: It returns the value of ByteObject as short. Below is the implementation of shortValue() method in Java: Example 1: Java // 2 min read Byte byteValue() method in Java with examples The byteValue method of Byte class is a built in method in Java which is used to return the value of this Byte object as byte. Syntax ByteObject.byteValue() Return Value: It returns the value of ByteObject as byte. Below is the implementation of byteValue() method in Java: Example 1: Java // Java co 2 min read Like