I need to handle a set of objects of the same type, as in the photo, the best option is List<>?

I need to handle a set of objects of the same type, as in the photo, the best option is List<>?

Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vishvjit ShindePosted Oct 4, 2022, 8:54 AM
Yes, You can go with List
Vishal JoshiPosted Oct 3, 2022, 8:49 AM
Hello
There are several options List, Array, ArrayList, Dictionary, etc. you can use either List or Dictionary. I would suggest if you are using lookup in your requirements go for Dictionary.
Because, When it comes to the lookup of data, a keyed collection is always faster than a non-keyed collection. This is because a non-keyed collection will have to enumerate its elements to find what you are looking for. While in a keyed collection you can just access the element directly via the key.
List<> is a non-keyed collection.
Dictionary is a keyed collection.
Rajanikant HawaldarPosted Oct 3, 2022, 8:13 AM
it depends if the collection has to grow or not and how do you access it (randomly, sequentially...)