[Solved] Class, interface, or enum expected when compiling


I’m not going to do your homework for you but here are some hints:

  1. You need to put all your code inside a class
  2. You need to put the code in the main method. (Search on Google) the method served for an entry point.
  3. You only need one for loop… Loop through the array, if the value equals 0, return the index number. After the loop just return -1.

solved Class, interface, or enum expected when compiling