Java Data Type Tutorial - Byte intValue() example








Byte intValue() returns int from byte value.

Syntax

intValue has the following syntax.

public int intValue()

Specified by

intValue in class Number

Return

intValue returns the int from this Byte object.

Example

In the following code shows how to use Byte.intValue() method.

public class Main {
  public static void main(String[] args) {
    Byte byteObject = new Byte("10");

    int i = byteObject.intValue();
    System.out.println("int:"+i);

  }
}

The output: