1
Answer

Object Oriented (OOPs) question

Spark C

Spark C

17y
2.1k
1

Hi,
I have a class (MyObjectList) that contains an array of list of objects(MyObject).
At present when I am removing the object I traverse the list to check if parent of the current object(object to be removed) is the same as the object in the list. If it is then I remove it.

However I dont want to traverse the list but I want a reference in the MyObjectList class in such a way that whenevr I have an object in hand to be removed I can directly remove itfrom the list without iterating the entite list. This is pure oops.. Can somebody help?

Answers (1)