Real life Application of Indexers | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Real life Application of Indexers

Example of app that uses indexers. Or real life application of indexers

16th Nov 2016, 9:30 AM
Victor Ogudu
Victor Ogudu - avatar
1 Answer
+ 2
If you have ever used a for loop you have some idea of what an indexer is for an how to use it. As an example lets say you pull a list of active employees from a database and would like to display data on each of them. Instead of pulling them one by one from the database you would pull a collection and iterate through it in your code. You do this because if you have 1000 employees its one call vs 1000 calls and you can then take that collection and iterate through it with a for loop or a lambda expression (which does the same thing) to grab the details of each employee at that index and display that data according to your design.
21st Nov 2016, 8:31 PM
Code-Bear
Code-Bear - avatar