This method returns the coordinates in a game of Battleship. Why is the array declared with two integers instead of one? It would be very helpful if someone could comment each line of code so I can get a better understanding of what is going on. Thanks.public int[] getCoordinates(String input){ int[] coordinates = new int[2]; String[] strList = input.split(” “); int row = strList[0].charAt(0) – ‘a’; int col = Integer.parseInt(strList[1]); coordinates[0] = row; coordinates[1] = col; return coordinates;}
Expert
OR
PayPal Gateway not configured
OR
PayPal Gateway not configured
PayPal Gateway not configured
PayPal Gateway not configured