- Unabbreviated names would be nicer.
- Immutable properties (row, column) should be made final.
- Package private directly accessible - especially mutable - fields are not likedone should avoid.
...have their uses, but not here.{}in generally also are Always used.
So:
public class Cell {
public static final int BOMB = -1;
final int row;
final int col;
boolean revealed;
int value;
public Cell(int row, int col) {
this.row = row;
this.col = col;
}
Critics:
cellRepbelongs more to classCell. You could make it acharmethod, in order to have just one char, for the board representation.printBoardbelongs more toBoard.- You might consider the board size as constructor Parameters too.
Design criticism:
row and col are redundant.
There are also a couple of pitfalls you avoided, so in general the code is not bad.