(I've reversed the order of my paragraphs to put the important stuff first. If my question doesn't make sense, reading further back in time may clarify)
The big question I have is wether there's a way to use a reference (ie objArray[0].v1 = 42) directly when using a map. I've unly came across:
as my way of actually "using" the objects referenced by my map. How can I directly use an object referenced by a TreeMap?
I'm working with a bunch of dynamically-created objects, and this has worked fine so far. I would, however, prefer to use a TreeMap instead of an array, so I can just iterate through the objects that exist, rather than iterating through thousands of array cells waiting to stumble on the ones I'm actually using.
To my understanding, I just created an array of TestObj references, referenced a new object via objArray[0], and returned the value of the v1 variable of the object referenced by objArray[0].
Consider the following: