+ 2
Why this code is giving ERROR
int a=028; System.out.println (a); OUTPUT: error
6 Answers
+ 4
Pradeep, Because any number starting with "0" is considered to be an octal value, and there is no digit above 7 in octal notation. In octal, 030 is next after 027.
If you try and observe you may understand, try 027 its working but not 028 because of above reason.
+ 1
Pradeep, this is because you try to save large integer like 028, try with 28 its working.
+ 1
thnks guys
0
turn 028 into 28, this should fix.
0
why 028 is large value for int type
0
why it is error? I can't understand! can anyone explain still clearly?