The foreach keyword is just a synonym for the for keyword, so you can use foreach and for interchangeably...