Java get maximum short value

Tags: short

In this Java core tutorial we learn how to get the maximum short value in Java programming language.

How to get maximum short value in Java

In Java, we can get maximum short value using the Short.MAX_VALUE constant as the following Java program.

GetMaxShortValueExample.java

public class GetMaxShortValueExample {
    public static void main(String... args) {
        // Get maximum short value
        short maxShortValue = Short.MAX_VALUE;

        System.out.println("Maximum short value: " + maxShortValue);
    }
}
The output as below.
Maximum short value: 32767

Happy Coding 😊

Java get minimum short value