Well I'm not sure how to program this, but anyway, I need to make 81 objects and assign their value (int value).
So My Class is:
public class Cell { int value; int xloc; int yloc; int possiblevalues[]; }
And I need basically 81 objects;
I really don't want to say
All my values are stored in a array, so is there any way to efficiently:Cell one = new Cell(); Cell two = new Cell(); one.value etc etc
Make 81 objects, assign their values without repeating what I said above?
I was thinking a for loop and an array of some sort, but I'm not quite sure how to approach this;
I got this far:
Not sure what I did but it seems to work?
public void assignvalues(){ GetDataMethods one = new GetDataMethods(); Cell[]cellarray; //Declares a Array of the type Cell cellarray = new Cell[81]; // Makes 80 slots, starting with 0 for(int x =0;x<=80;x++){ System.out.println(cellarray[x]); } }