Phenomenal answer. Thanks! So would a Java dev just declare a new array one index larger than the old one when adding items? Or would one not use arrays for the same purposes in Java?
I promise I don't intend on tricking you into teaching me Java through an OT cf-talk thread. On Thu, Sep 23, 2010 at 9:06 PM, Leigh <[email protected]> wrote: > > > OT: Or slightly anyway. How do you alter an array in Java? > > I'm completely > > unfamiliar with Java so maybe that's a dumb question. And I > > know I could > > Google it but I'll probably spend two hours reading and not > > get as concise > > an answer as I'd get here in a few sentences. > > > Java arrays are a little different than CF "arrays". You have to declare a > java array's size up front. Once declared, the array is immutable. So unlike > in CF, you cannot append elements or remove them. You can only change the > values of existing elements. > > So it is not really what we think of as an "array" in CF terms. When you > think CF array, think java "List". ie A modifiable collection of elements. > Because that is essentially what it is internally: a java.util.List > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337438 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

