Solution :
I read your question on Java. As you are beginner in java you are facing these exceptions.
I think you have done two mistakes in your java code:
First mistake is you are facing the ArrayIndexOutOfBoundsException :0 it clearly informs that your code is trying to reach the array value with the index value which out of array range.
Second mistake is you want to use the command line arguments but you may not be entering any arguments as the parameter. The main method supposes needs 5 parameters in order to run without any error but with zero parameters. args[0]
, args[1]
, args[2], args[3] and args[4]
means You have the array with name as args[] and now you want to reach 0th, 1st ,2nd,3rd ,4th elements of your args[] named array. But if you are providing zero command-line parameter then you are trying to reach the null value and so you are facing;
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at Minesweeper.main(Minesweeper.java:5)”.