Java Data Type Tutorial - Byte longValue() example








Byte longValue() returns long value from this Byte.

Syntax

longValue has the following syntax.

public long longValue()

Specified by

longValue in class Number

Return

longValue returns a long value from this Byte.

Example

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

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


    long l = byteObject.longValue();
    System.out.println("long:"+l);
  }
}

The output: