class Main {
public static void main (String[] args){
long value = 1024 * 1024 * 1024 * 80;
System.out.println(Long.MAX_VALUE);
System.out.
This code:
long value = 1024 * 1024 * 1024 * 80;
multiplies some integers together, converts it to a long and then assigns the result to a variable. The actual multiplication will be done by javac rather than when it runs.
Since int is 32 bits, the value is wrapped and results in a zero.
As you say, using long values in the right hand side will give a result which only wraps if it exceeds 64 bits.