今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Iterating collection elements
- [Instructor] When working with Java Collections, it's common to traverse or iterate through each element in the collection, one after the other. Initially, the framework provided an iterator for the task, or a basic loop was used. Then, new versions of Java introduced language features like the enhanced for-each loop, and streams that gave us new approaches for navigating collection elements. At a high level, we can categorize the approaches for traversing a collection into three groups, loops, iterables, and streams. First let's talk about loops. These are the trusted while, do-while, and for loops that we learned when starting out with Java. They can be used to iterate collection implementations that allow positional or reference-based access to the elements that they hold. You'll notice I've placed for-each loops into this group. Using its concise syntax requires the object we are traversing to implement the iterable…
内容
-
-
-
-
-
(已锁定)
Iterating collection elements2 分钟 55 秒
-
(已锁定)
Accessing collection elements with iterators6 分钟 4 秒
-
(已锁定)
Modifying collections while iterating4 分钟 39 秒
-
(已锁定)
Accessing collection elements with streams5 分钟 38 秒
-
Lambda expressions2 分钟 56 秒
-
(已锁定)
Stream operations4 分钟 17 秒
-
(已锁定)
Challenge: Iterating collections5 分钟 23 秒
-
(已锁定)
-
-
-
-
-
-