0
int [] array = new int[] {12, 6, 78, 9, 45, 08};

And this pop up Main.java:7: error: integer number too large int [] array = new int[] {12, 6, 78, 9, 45, 08}; ^ 1 error

Chaosfire
  • 4,818
  • 4
  • 8
  • 23
  • Please, post a [Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) – Ele Jun 20 '22 at 08:56
  • 2
    When you write a number starting with a zero as you did in `08`, then Java is going to interpret it as an [octal](https://en.wikipedia.org/wiki/Octal) integer literal. In octal, there are only 8 digits, 0 to 7. The digit 8 is not a valid octal digit. Therefore you get the error. Solution: Write `8` instead of `08`. – Jesper Jun 20 '22 at 08:59
  • But the output provided by our professor included the 08 in the list. – John Mark Entrina Jun 21 '22 at 06:22

0 Answers0