Compiler Error J0028

Invalid number

The compiler detected a numeric value that the Java language is not capable of supporting. This error usually occurs when the number specified is an amount that is outside of the range of any of Java's primitive data types. This error usually occurs when a numerical value is too large to be stored in the specified data type.

The following example illustrates this error:

public class Simple {
   
   long i = 12345678901234567890; 
   // error: value out of range for 'long'
   
}