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

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.

主站蜘蛛池模板: 定日县| 迁西县| 炎陵县| 津市市| 慈利县| 景洪市| 曲沃县| 云梦县| 沾益县| 葫芦岛市| 临湘市| 宜州市| 南靖县| 五家渠市| 施秉县| 清丰县| 凉山| 黄大仙区| 偃师市| 乌什县| 灵山县| 仲巴县| 衡南县| 大竹县| 临安市| 永吉县| 西和县| 加查县| 余庆县| 莲花县| 开鲁县| 华阴市| 余姚市| 巫溪县| 卓尼县| 类乌齐县| 平度市| 台湾省| 浑源县| 磐安县| 株洲县|