Java Data Type Tutorial - Byte SIZE example








Byte SIZE stores the number of bits used to represent a byte value.

Syntax

SIZE has the following syntax.

public static final int SIZE

From version

1.5

Example

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

To get the size of a byte 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 Byte:"+Byte.SIZE);
  }
}

The output: