First create the array:
Dog[,] arrayname = new Dog[5, 3];
Initialize however much of it needs to be initialized, remember the first line gave you only a bunch of null references:
arrayname[0, 0] = new Dog();
arrayname[2, 1] = new Dog();
arrayname[3, 2] = new Dog();
Use it:
arrayname[2, 1].Eat();
statice
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment