Q: How to create the correct relationship between classes I have a feeling this question is going to be something really common sense that I am overcomplicating. I am working on a random maze generation program, so given a width, height, and maximum path length, it will randomly select a start point and generate a path until the max path length is reached or it dead ends/gets stuck, then it will pick a new start point for another path and repeat until the whole grid is filled. I am just creating it for the practice.
I have 3 classes, but I guess I do not really understand how they should interact, or how I should make them interact for the best performance and such. One thing in particular, I just know is terrible practice. Since my Path and Point classes have to operate on the grid of Points that is created in the Maze class, I pass the constructors for Path and Point that Array of Points. It "works"... but I just realized that in doing that, I get a seemingly infinite loop where I create a grid, and create all the points for that grid, and in those points I pass an Array of Points, and each of those Points gets passed an Array of Points, forever.
I thought about making Path and Point extend Maze, but I do not think that is the right relationship. I googled interfaces and abstract classes to see if maybe that is what I wanted, but those did not seem right either.
Maze constructor: 
public class Maze
{
private int fileNum = 0;

private Random rand = new Random();
private Point[] grid;
private int width, height;
private int pathLength;
private int curLoc;

private boolean debug, toTxt, toPng, hasValidNewHead = true;

public int frameNum = 0;
public int lastPercent = 0;

public Maze(int iWidth, int iHeight, int iPathLength, boolean d, boolean txt, boolean png)
{
    width = iWidth;
    height = iHeight;
    pathLength = iPathLength;
    grid = new Point[width * height];
    debug = d;
    toTxt = txt;
    toPng = png;
}

Path constructor: 
public class Path
{
private Random rand = new Random();
private Maze maze;
private int length, maxLength, lastDir, height, width;
private int curLoc;
private boolean generating;
private Point[] grid;
private boolean debug, toTxt, toPng;

public Path(int head, int gridWidth, int gridHeight, int ml, Point[] iGrid, Maze m, boolean d, boolean txt, boolean png)
{
    maze = m;
    generating = true;
    lastDir = -1;
    length = 1;
    grid = iGrid;
    curLoc = head;
    height = gridHeight;
    width = gridWidth;
    maxLength = ml;
    debug = d;
    toTxt = txt;
    toPng = png;
}

Point constructor:
public class Point
{
private int x, y, width, height;
private Point[] grid;
private int type, curLoc;

public Point(int iX, int iY, int w, int h, Point[] iGrid)
{
    x = iX;
    y = iY;
    width = w;
    height = h;
    grid = iGrid;
    curLoc = Arrays.asList(grid).indexOf(this);
    type = 0;
}


A: Mazes are annoying to model because they're either structured around rooms or walls, you need different ones at different times, and either way, you'll end up with tricky code or redundant data and awkward record keeping.
Thad said, Paths are sequences/Lists of moves (North, South, East West), a Maze is an array (or Map) from a coordinate to a Cell/Room, and Cells have boolean walls keyed on moves, so { East: true, North: false, South, false, West: true}.
Or you could just make it an undirected graph.

A: All I had to do was make the Path and Point classes inner-classes in my Maze Class. That way they have all of the instance data from Maze that they need without needing to pass it through their constructors.
