10장 썸네일형 리스트형 10장. foreach가 가능한 객체 만들기 1. IEnumerable과 IEnumerator [C#] IEnumerable, IEnumerator 그리고 yield enumerate 영어로 수를 세다. 카운팅 하다! 두 인터페이스는 열거자와 관련이 있다.(반복자와 동일한…것 같다. 아닐수도..) using System.Collections; C#의 모든 Collections 컬렉션은 IEnumerable, IEnumerator를 상 ansohxxn.github.io foreach를 사용할 수 있는 클래스를 만들기 위해서는, IEnumerable 인터페이스와 IEnumerator 인터페이스를 상속하고 메소드와 프로퍼티를 구현해야 함 [C#] IEnumerator IEnumerable 컬렉션namespace System.Collections{ pub.. 더보기 이전 1 다음