Require a specific (int) cast for int n2 = 4096L : long « Java Source And Data Type « SCJP






public class MainClass{
    public static void main(String[] argv){
        int n2 = 4096L ;  // would require a specific (int) cast
        System.out.println(n2);
    }
}
Type mismatch: cannot convert from long to int








1.13.long
1.13.1.To indicate a long (64-bit) literal, append the suffix L to the literal expression.
1.13.2.Require a specific (int) cast for int n2 = 4096L