官术网_书友最值得收藏!

The iterator pattern

The iterator pattern is probably one of the most well-known patterns in Java. Some Java programmers are using it without being aware that the collection package is an implementation of the iterator pattern, regardless of the type of the collection: array, list, set, or any other types.

The fact that we can deal in the same way with a collection, regardless of whether it's a list or an array, is because it provides a mechanism to iterate through its elements without exposing its internal structure. What's more, the same unified mechanism is used by different types of collections. The mechanism is called the iterator pattern.

主站蜘蛛池模板: 石河子市| 加查县| 电白县| 瓮安县| 安宁市| 滁州市| 江安县| 辛集市| 周宁县| 静乐县| 杭锦旗| 新晃| 北海市| 昭苏县| 集贤县| 鄢陵县| 马关县| 张家口市| 桐柏县| 凤凰县| 苏尼特右旗| 日照市| 井陉县| 定陶县| 韶山市| 平凉市| 宁乡县| 姜堰市| 绵阳市| 通化县| 沙雅县| 广元市| 绥中县| 黄平县| 漳浦县| 铁岭市| 苍溪县| 喀喇沁旗| 南安市| 子长县| 托克托县|