From the course: Java: Lambdas and Streams

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Understanding streams

Understanding streams - Java Tutorial

From the course: Java: Lambdas and Streams

Understanding streams

- [Instructor] The other big important feature that was introduced in Java 8 was the streams API. When you use streams together with lambdas, the streams API allows you to process groups of elements in powerful ways using functional style programming. Like with lambdas, the syntax can take a bit of practice to get used to, but once you have got used to it, streams allow you to write nice, concise code. And being able to read and understand streams with lambdas is really important because a lot of Java code that's been written since Java 8 uses this syntax. So let's think about an example of where streams might be used. Let's say we have an array list of strings containing the names of countries, and let's say you want to process the elements in that list in some way. So for example, you want to capitalize all the letters and then you want to filter out all the countries beginning with a C, and then you want to print out…

Contents