Can anyone please let me know What is difference between "For loop" OR "Foreach loop" & which is faster from both of them?
I searched on internet but can't find any detailed answer with example. :-/
The only difference I found is :-
- For :- should be used when wants to iterate for a fixed number of times.
- Foreach :- should be used when wants to iterate through collection.
Please help me out here.
Any help is appreciated. :-)
Thanks.