Possible Duplicate:
Direct casting vs 'as' operator?
Can any one tell the actual difference between snippet of code?
var unknown = (object)new List<string>();
// Snippet 1: as operator
foreach (var item in unknown as IList<int>) {
// Do something with item
}
// Snippet 2: cast operator
foreach (var item in (IList<int>)unknown) {
// Do something with item
}