1
Reply

For getting a list of objects from database and binding to grid view which loop is faster... For or For each ?

Srikanth Reddy

Srikanth Reddy

Dec 03, 2016
447
0

    foreach is much slower than for loop as it uses more memory space for local variables. but when it comes to type-safe iteration and avoiding null pointer exception then foreach is best option.

    Santosh Gadge
    April 19, 2017
    0