View Single Post
  #1 (permalink)  
Old 07-24-2007, 05:58 AM
toby toby is offline
Member
 
Join Date: Jul 2007
Posts: 40
toby is on a distinguished road
Array with objects
Hi, I have made myself a class like follows

Code:
class State { static int[][] grid = new int[2][2]; static int parent; static int depth; }
And would like many instances of this class. I tried

Code:
State[] states = new State[1000];
But it does not set each instance correctly when I try states[0].grid = .... It treats it like one instance. What is the correct way to do this?
Thanks.
Reply With Quote
Sponsored Links