+ 2
Why it gives an error massage?
5 odpowiedzi
+ 3
Numbers that start with 0 are considered to be in octal system.
So the problem here is the last digit '8', since in the octal system only digits from 0 to 7 are allowed.
023 for example would work, yielding 2*8+3 = 19 in the usual decimal system
+ 2
Because an int shouldn't start with 0, change it to a=28
+ 2
you can also read this article:
https://stackoverflow.com/questions/7218760/why-is-08-not-a-valid-integer-literal-in-java
+ 1
Please mention the language (Java) in Relevant Tags 👍
0
Please mention the language (Java) in Relevant Tags 👍