Online Java Compiler By
JavaTpoint.com
public class JavaByteShortValueExample1 { public static void main(String[] args) { Byte b1=98; Byte b2=102; //returns the numeric value of this object after conversion to type short. Short val=b1.shortValue(); System.out.println("1. Short value : "+val); System.out.println("2. Short value : "+b2.intValue()); } }
Output