We have supplied a separate solution file called TreasureHunt_Solution.java, which shows one way to solve the problem.
Notice that there are two classes in this project that have main methods: TreasureHunt_Solution and the class we asked you to edit to write your own solution, called TreasureHunt.
There is more than one approach to running the solution file.
Click the Browse button and the Browse Main Classes dialogue will open. Click on ex3_2.TreasureHunt_Solution to select it as the main class.
Click the Select Main Class button, and then OK.
Now TreasureHunt_Solution.java can be run by choosing Run|Run Main Project or by clicking the Run Main Project button on the NetBeans toolbar.
Note that the class you choose as the main class needs to contain a main method.