Q:

How do I create an object in another class when the parameter is out of scope?

I have three classes: Mazesolver, Hexagon, and Maze. When I try to create a Hexagon object in the Mazesolver class an error occurs. Can anyone please help me with this problem? Also, what does it mean to obtain a reference to the Start Hexagon in the maze?
public class Hexagon extends HexComponent
{
    // constants
    private static final Color WALL_COLOR = Color.BLACK;
    private static final Color START_COLOR = Color.GREEN;
    private static final Color END_COLOR = Color.YELLOW;
    private static final Color UNVISITED_COLOR = Color.CYAN;
    private static final Color PROCESSED_COLOR = Color.BLUE;
    private static final Color PUSHED_COLOR = Color.MAGENTA;
    private static final Color END_PROCESSED_COLOR = Color.RED;
    private static final Color START_PROCESSED_COLOR = Color.PINK;

    //enum to represent available hexagon types
    public static enum HexType{WALL, START, END, UNVISITED, PROCESSED, PUSHED,       END_PROCESSED, START_PROCESSED};

    // Attributes   
    private HexType type;    // Stores the type of Hexagon this currently is  
    private boolean isStart;  // Is this the start?
    private boolean isEnd;    // Is this the end?
    private Hexagon[] neighbors; // Stores the hexagons which surround this one  on each of 6 sides

    /**
     * Create a Hexagon tile of the specified type 
     * @param t the HexType to create
     */
    public Hexagon(HexType t) {
        this.type = t;
        this.isStart = t == HexType.START;
        this.isEnd = t == HexType.END;

        //set the initial color based on the initial type
        this.setColor(this.type);
        //allocate space for the neighbor array
        this.neighbors = new Hexagon[6];
    }

How do I create a object of Hexagon in MazeSolver?
public class MazeSolver 
{
    public static void main (String[] args) {
        try {
            if (args.length < 1) {
                throw new IllegalArgumentException("No Maze Provided");
            }
            String maze0 = args[0];
            private ArrayStack<String> steps;
            Hexagon Start = new Hexagon(t);  //error
        }

A:

I am no coding Guru but it may be because the only Hexagon constructor requires you to pass a HexType value. I may be wrong but what I think the problem is, is that you are passing t into your Hexagon constructor when t is not a HexType value. You need to pass one of these to your Hexagon constructor: HexType.WALL, HexType.START, HexType.END, HexType.UNVISITED, HexType.PROCESSED, HexType.PUSHED, HexType.END_PROCESSED, HexType.START_PROCESSED. 
EDIT: So yea I think it is safe to say you just have to pass HexType.VALUE to your Hexagon constructor, VALUE being any value of your HexType enum class.  
I am new to StackOverFlow, please let me know if I am wrong so I can delete my answer or at least correct it. 

