foreach works on IEnumerable, which returns objects of type object. For every item, the object will be cast to the type you provided.
Unless you use var in C# 3.0. Then the type will be taken from IEnumerable, if it is implemented by the collection.