2012. 8. 23. 10:48
List<Person> people = new List<Person>();
people.Add(new Person("kim sam soon", 12));
people.Add(new Person("park chul soon", 23));
people.Add(new Person("obama", 65));
people.Add(new Person("lee so ryong", 11));
people.Add(new Person("choo shin soo", 27));
people.Add(new Person("buffet", 80));
var enumerator = (IEnumerator<Person>)people.GetEnumerator();
while(enumerator.MoveNext() != false){
var e = enumerator.Current;
Console.WriteLine("e = {0}, {1}", e.Name, e.Age);
}
'C#, .NET' 카테고리의 다른 글
C# GeneralSort, ThreadSort, ParallelSort (0) | 2012.08.23 |
---|---|
C#에서 프로세서 개수 알아내기 (0) | 2012.08.23 |
C# 및 SQL 강좌 (0) | 2012.08.22 |