Okay, so I'm working on a battleship game, and I added these two tables which are throwing all sorts of errors, like:
- Illegal Start of Expression,
- Not a Statement,
- ';' expected,
- ']' expected,
- <identifier> expected.
I have no idea why... Help, please?
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class PlayerControl {
private static int[] has;
private static int[] placed;
static ActionListener aListen = new ActionListener() {
public void actionPerformed(ActionEvent e) {
...
}
};
private static void menuAction(JMenuItem menuItem) {
...
}
private static void buttonAction(JButton button) {
...
}
static void placeShips() {
has[10] = {5, 4, 4, 3, 3, 3, 2, 2, 2, 2}; //HERE
placed[10] = {}; //HERE
JFrame instructionPlace;
// instructionPlace.setVisible(true);
}
}