(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.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, and returned the value of the v1 variable of the object referenced by objArray.
Consider the following: