Getting the neighbors of a Point in a 2D grid
Improvements

Use x and y names to avoid confusion about what is i and what is j
I personally find it preferrable to put the x parameter first
rows and cols should not be static variables, so neither should this method
Use a double for-loop to loop over the neighbors
Declare by interface and not implementation (use List&lt;Point&gt; when possible)
Use some maths to check if you're at a corner or not

Code
private List&lt;Point&gt; getNeighborsOfPoint(int x, int y) {
    List&lt;Point&gt; neighbors = new ArrayList&lt;Point&gt;();
    for (int xx = -1; xx &lt;= 1; xx++) {
        for (int yy = -1; yy &lt;= 1; yy++) {
            if (xx == 0 &amp;&amp; yy == 0) {
                continue; // You are not neighbor to yourself
            }
            if (!CONSIDER_CORNERS &amp;&amp; Math.abs(xx) + Math.abs(yy) &gt; 1) {
                continue;
            }
            if (isOnMap(x + xx, y + yy)) {
                neighbors.add(new Point(x + xx, y + yy));
            }
        }
    }
    return neighbors;
}

public boolean isOnMap(int x, int y) {
    return x &gt;= 0 &amp;&amp; y &gt;= 0 &amp;&amp; x &lt; cols &amp;&amp; y &lt; rows;
}

In this code, I have not added your array[i][j] != 0 check, but that can easily be added into isOnMap, although you could then rename it to isValidNeighbor or something.
Going the extra mile
Having this method, it is very easy to add support for some very crazy neighbor styles. This might not fit your game, but using crazy neighbor styles can transform a concept into an entirely different game.
For example, take Minesweeper Flags (where the objective is to find the mines and not avoid them).

We all know what an 8 means, right? 8 mines around the number, plain and simple.

Now, what if we transform the way we look for neighbors? To what I call &quot;Chess style&quot; (based on how a Knight moves in Chess).

This &quot;simple&quot; change leads to a much greater challenge when playing, leading to all kinds of fun.
The change required for this is really simple, extract a NEIGHBOR_SET array:
private static final Point[] NEIGHBOR_SET = new Point[]{ new Point(-2, -1), new Point(-2, 1), 
   new Point(-1, -2), new Point(-1, 2), new Point(1, -2), new Point(1, 2), new Point(2, -1), new Point(2, 1) };

private List&lt;Point&gt; getNeighborsOfPoint(int x, int y) {
    List&lt;Point&gt; neighbors = new ArrayList&lt;Point&gt;();
    for (Point neighbor : NEIGHBOR_SET) {
        if (isOnMap(x + neighbor.x, y + neighbor.y)) {
            neighbors.add(new Point(x + neighbor.x, y + neighbor.y));
        }
    }
    return neighbors;
}

Using this method, the special case logic for handling corners and the self neighbor is no longer necessary.
Of course, using the ordinary neighbor set is also possible with this method:
private static final Point[] NEIGHBOR_SET = new Point[]{ new Point(-1, -1), new Point(-1, 0), 
   new Point(-1, 1), new Point(0, -1), new Point(0, 1), new Point(1, -1), new Point(1, 0), new Point(1, 1) };