java.lang.Short longValue()

Description

The longValue() method of Short class returns the value of this Short as a long after a widening primitive conversion.

Important Notes:

  • This method is specified by longValue in class Number.

Method Syntax

public long longValue()

Method Argument

Data Type Parameter Description
N/A N/A N/A

Method Returns

The longValue() method of Short class returns the numeric value represented by this object after conversion to type long.

Compatibility

Requires Java 1.1 and up

Java Short longValue() Example

Below is a simple java example on the usage of floatValue() method of Short class.

Sample Output

Below is the sample output when you run the above example.

Java Short longValue method example output