Thou shalt not try me. Mom 24:7
Steve
Thou shalt not try me. Mom 24:7
Joel Christophel wrote:You've made the container, but you need to fill it.
Thou shalt not try me. Mom 24:7
Jim Venolia wrote:My understanding is the line "Foo[] foo = new Foo[MAX_FOO];" creates an array of 256 Foo objects, with all x, y values initialized to 0. Is my understanding incorrect?
Steve
Jim Venolia wrote:The whole point to parseFoo() is to fill it
Steve
Thou shalt not try me. Mom 24:7
Steve
Jim Venolia wrote:After the Foo[] foo = new Foo[256] line I put a for loop to get a new Foo() and stuff it into the array. Is there a better way to do it?
It works, I tried it. Just seems like an inelegant way to do things.
Thanks for all your help!
Thou shalt not try me. Mom 24:7
There are three kinds of actuaries: those who can count, and those who can't.
Piet Souris wrote:You could consider using a HashSet<Foo>.
Steve
There are three kinds of actuaries: those who can count, and those who can't.
There are three kinds of actuaries: those who can count, and those who can't.
There are worse crimes than burning books. One of them is not reading them. Ray Bradbury
Robert D. Smith wrote:I see that the problem has been solved (as usual I'm a day late and at least a dollar short). For initializing the array, why not use the array.fill method? Is there something inherently wrong with it? According to the Oracle Documentation, array.fill(object[] a, object[] value) would take care of it.
I didn't notice it being mentioned in any of the other replies.