L
laredotornado
Hi,
I'm using Java 1.6. I was wondering if there is a shorter way to do
this. I initialize my array and then loop through the array,
assigning a newly created element at each step ...
DatePref[] prefs = new DatePref[arraySize];
for (int i=0; i<prefs.length; i++) {
prefs = new DatePref();
...
}
I was wondering if there was a more all-in-one solution for
initializing the array and automatically calling the constructor for
each object in the array. It is fine if we change the rules to use
some type of Collection as opposed to an Object[] .
Thanks, - Dave
I'm using Java 1.6. I was wondering if there is a shorter way to do
this. I initialize my array and then loop through the array,
assigning a newly created element at each step ...
DatePref[] prefs = new DatePref[arraySize];
for (int i=0; i<prefs.length; i++) {
prefs = new DatePref();
...
}
I was wondering if there was a more all-in-one solution for
initializing the array and automatically calling the constructor for
each object in the array. It is fine if we change the rules to use
some type of Collection as opposed to an Object[] .
Thanks, - Dave