Java Data Type Tutorial - Java Short SIZE








Syntax

Short.SIZE has the following syntax.

public static final int SIZE

Example

In the following code shows how to use Short.SIZE field.

To get the size of a short value, just call its static constant SIZE as the follows:

public class Main {

  public static void main(String args[]) {
    System.out.println("Size of a Short:"+Short.SIZE);
  }
}

The code above outputs: