课程: Java: Advanced Concepts for High-Performance Development
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Understanding streams in Java - Java教程
课程: Java: Advanced Concepts for High-Performance Development
Understanding streams in Java
- [Instructor] Streams provide a powerful way to work with sequences of elements in Java. They have a slightly confusing name and that they sound similar to input and output streams, but actually, they're completely different things. The most common way to create a stream using the Streams API is from an existing collection. So for example, if I have a list of integers called numbers, I could turn that into a stream by doing numbers.stream to call the stream method, and that would give me back a stream. There are two different types of operation you can perform on a stream, intermediate and terminal. Intermediate operations always return another stream so you can chain them together. Terminal operations return void or any other type that's not a stream, so you can't call anything else once you've called a terminal operation. One example of an intermediate method is sorted. So if I call the sorted method on my stream of…
内容
-
-
-
-
-
-
Functional Interfaces in Java3 分钟 39 秒
-
(已锁定)
Implementing lambdas in Java2 分钟 31 秒
-
(已锁定)
Using method references in Java3 分钟 20 秒
-
(已锁定)
Understanding streams in Java1 分钟 24 秒
-
(已锁定)
Using streams in Java4 分钟 25 秒
-
(已锁定)
Challenge: Functional programming2 分钟 43 秒
-
(已锁定)
Solution: Functional programming3 分钟 30 秒
-
-
-
-
-