sheng-jie/Design-Pattern

Iterator的int是否應該為string?

Opened this issue · 0 comments

此處的型別應該是string
經測試,使用int會出例外狀況

int i = (int)iterator.GetCurrent();

因為ConcreteList內部的_collection是string陣列

_collection = new string[] { "A", "B", "C", "D" };