文件名称:08:集合的多种遍历方式.pdf
文件大小:116KB
文件格式:PDF
更新时间:2022-09-09 16:16:36
集合的多种遍历
foreach (Object obj in list) { if (obj is Student) { Student s = obj as Student; Console.WriteLine(s.Name); } else if (obj is Person) { Person p = obj as Person; Console.WriteLine(p.Name); }