Java Data Type Tutorial - Java Short(short value) Constructor








Syntax

Short(short value) constructor from Short has the following syntax.

public Short(short value)

Example

In the following code shows how to use Short.Short(short value) constructor.

public class Main {
  public static void main(String[] args) {
    short s = 101;
    Short shortObject2 = new Short(s);
    System.out.println(shortObject2);
  }
}

The output: