I'm missing something as how to initialize arrays, specifically how an integer array differs from a class array, in this respect.
If I have a class myclass and would like to create a myclass array of 5 elements/objects, why doesn't the following work:
myclass[] myclassArray = new myclass[5];
I would think that myclassArray has 5 myclassobjects ready to be used with myclassArray[x].mystring="TEST"; (x=0 thru 4).
In reality though myclassArray is null and throws an exception.
TIA
-Nat
If I have a class myclass and would like to create a myclass array of 5 elements/objects, why doesn't the following work:
myclass[] myclassArray = new myclass[5];
I would think that myclassArray has 5 myclassobjects ready to be used with myclassArray[x].mystring="TEST"; (x=0 thru 4).
In reality though myclassArray is null and throws an exception.
TIA
-Nat