long

The $\lstinline{long}$ data type can have values from $-2^63$ to $2^{63}-1$ (64-bit signed two's complement integer). If you are using Java 8 or later, you can use unsigned 64-bit integer with a minimum value of 0 and a maximum value of $2^{64}-1$. Default value is 0.


\begin{lstlisting}
class LongExample {
public static void main(String[] args) {
\par
long range = -42332200000L;
System.out.println(range);
}
}
\end{lstlisting}

Notice, the use of L at the end of $-42332200000$. This represents that it's an integral literal of the long type. You will learn about integral literals later in this section.