javacollections

Can I get a reference to List<> object having a reference to one of its elements?


For example I have a reference to an mItem object of my List<mItem> mList collection. Is that possible to get a reference to mList using mItem?


Solution

  • The short answer is no. The items in a list don't know they are in a list. (Unless of course you add a reference to the list inside your mItem object.)