aspose file tools*
The moose likes Beginning Java and the fly likes Extracting elements from a 2D array in another class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Extracting elements from a 2D array in another class" Watch "Extracting elements from a 2D array in another class" New topic
Author

Extracting elements from a 2D array in another class

Natasha Reaney
Greenhorn

Joined: Oct 10, 2012
Posts: 15
Not sure if anyone will be able to help me with this but I am completely stuck so I figured it is worth a shot...

I am writing a program for an assignment and one of the steps is to use the index variable (created under a method called NTS.mapLetterIndexOf) and the direction constants (WEST, EAST, NORTH and
SOUTH) (which I declared and created in a class called NTS) to extract an element from the 2D array into the Main class. My teacher provides this example for extracting: westMap = adjMapLetters[mapPosition][WEST]. Only I have tried that and it does not work. Here is most of the code:

Main.java:



NTS.java:


... other code...



I need to figure out how I can extract the element from the array in the NTS class into the Main class. Any thoughts?
It is this part of the code that doesn't work.

[/code]

Thank you!!!
 
Don't get me started about those stupid light bulbs.
 
subject: Extracting elements from a 2D array in another class