File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes trying to understand array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "trying to understand array" Watch "trying to understand array" New topic

trying to understand array

Dheesan Dabycharun

Joined: Nov 16, 2009
Posts: 3

am new in java, trying to make a game of snakes n ladders, understood that an array like the below should be to make my board and image work together.
Am using an image with nos 1 to 100 designed on the boardfield.

boardfield = new Field[10][10];
for (int i = 0; i<10; i++){
for (int j = 0; j<10; j++){
boardfield[i][j] = new Field();

But i can't really understand how to make my image and my array can work together.
Anyone can advise me if i am going on the right track if i post the code here?

Tks in advance.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902

Dheesan Dabycharun wrote:But i can't really understand how to make my image and my array can work together.

Of course, you can add one more instance variable into class 'Field' which hold image for that board.

And welcome to JR.

[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
I agree. Here's the link:
subject: trying to understand array
Similar Threads
storing a set of integers in an array
data structure of choice.
Database to multi-dimensional array problem
Programing a sudoku solver
2-Dimensional Arrays?