Iterator迭代器原理

  引入   foreach (var item in hand)面試 {遍歷spa    item.Fly(); 對象 }索引   常見面試題:能夠foreach的條件 對象具備迭代器對象(GetEnumerator方法)接口 或,對象實現IEnumerable接口get     迭代器原理與意圖   原理:iterator 迭代器對象it 意圖:訪問聚合對象內容而不暴露其內部結構。class
相關文章
相關標籤/搜索