Java Get Maximum Byte Value

Tags: byte

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

How to get maximum byte value in Java

In Java, to get the maximum byte value we can use the Byte.MAX_VALUE constant as the following example Java program.

GetMaxByteExample.java

public class GetMaxByteExample {
    public static void main(String... args) {
        // Get Maximum Byte Value
        byte maxByte = Byte.MAX_VALUE;

        System.out.println("Maximum Byte Value: " + maxByte);
    }
}
The output as below.
Maximum Byte Value: 127

Happy Coding 😊

Java Get Minimum Byte Value