filmov
tv
#98 Stream API in Java
Показать описание
Check out our courses:
Coupon: TELUSKO10 (10% Discount)
Udemy Courses:
For More Queries WhatsApp or Call on : +919008963671
In this lecture we will learn:
- What is a stream?
- Methods present inside the stream interface
- Filter, Map and Reduce methods of stream
- Use of methods in Big Data
#1
- Stream is an interface, it contains a stream() method.
- Stream method return an object of type stream.
- Any operation can be performed inside the stream method.
- Any changes done inside the stream can be reflected on the actual list.
- Once we work with a stream, we can't reuse it. We can work with a stream only once.
#2
- Stream provides a lot of methods to work upon.
- filter() method returns a new Stream that contains the value which satisfies the given condition. The filter method is used to select elements as per the Predicate passed as an argument.
- map() takes each value and performs operations on it. It returns a stream consisting of the results of applying the given function to the elements of this stream.
- reduce() method does not return the stream but it gives the value of a type that you defined in the stream. It is used to reduce the elements of a stream to a single value.
The reduce method takes a BinaryOperator as a parameter.
#3
- If you want to use Big Data, then first you have to apply a filter on it to separate useful data.
- After applying a filter, you need to transform it into the required data with the help of a map.
- And the graph of it, can be made with the help of the reduce method.
- We can reduce the code by applying methods one after the other.
More Learning :
Donation:
PayPal Id : navinreddy20
Coupon: TELUSKO10 (10% Discount)
Udemy Courses:
For More Queries WhatsApp or Call on : +919008963671
In this lecture we will learn:
- What is a stream?
- Methods present inside the stream interface
- Filter, Map and Reduce methods of stream
- Use of methods in Big Data
#1
- Stream is an interface, it contains a stream() method.
- Stream method return an object of type stream.
- Any operation can be performed inside the stream method.
- Any changes done inside the stream can be reflected on the actual list.
- Once we work with a stream, we can't reuse it. We can work with a stream only once.
#2
- Stream provides a lot of methods to work upon.
- filter() method returns a new Stream that contains the value which satisfies the given condition. The filter method is used to select elements as per the Predicate passed as an argument.
- map() takes each value and performs operations on it. It returns a stream consisting of the results of applying the given function to the elements of this stream.
- reduce() method does not return the stream but it gives the value of a type that you defined in the stream. It is used to reduce the elements of a stream to a single value.
The reduce method takes a BinaryOperator as a parameter.
#3
- If you want to use Big Data, then first you have to apply a filter on it to separate useful data.
- After applying a filter, you need to transform it into the required data with the help of a map.
- And the graph of it, can be made with the help of the reduce method.
- We can reduce the code by applying methods one after the other.
More Learning :
Donation:
PayPal Id : navinreddy20
Комментарии