Online Java Compiler By
JavaTpoint.com
public class IntegerShortValueExample1 { public static void main(String[] args) { Integer obj1 = 225; // returns the value of this Integer as a short type short s = obj1.shortValue(); System.out.println("Value of s = " + s); Integer obj2 = -225; // returns the value of this Integer as a short type short s2 = obj2.shortValue(); System.out.println("Value of s = " + s2); } }
Output