#96 Need of Stream API in Java

Telusko
Telusko
51.5 هزار بار بازدید - 2 سال پیش - Check out our courses:Spring and
Check out our courses:

Spring and Microservices Weekend Live Batch : https://bit.ly/spring-live-weekend
Coupon: TELUSKO10   (10% Discount)

Master Java Spring Development : https://bit.ly/java-spring-cloud

Udemy Courses:

Java:- https://bit.ly/JavaUdemyTelusko
Spring:- https://bit.ly/SpringUdemyTelusko
Java For Programmers:- https://bit.ly/javaProgrammers

For More Queries WhatsApp or Call on  :  +919008963671

website : https://courses.telusko.com/


In this lecture we will learn:
- What is Stream API?
- Method in a stream interface
- Difference between normal and enhanced for loop
- forEach method in a list interface


#1
- Stream API is the concept introduced in Java 1.8 version.
- The Stream API is used to process collections of objects.
- Stream is a sequence of objects that supports various methods to produce the desired result.
- asList() is a method that gives a list that belongs to a class array.
- Stream is an interface that belongs to java.lang package.
- Stream interface provides a lot of methods like filter(), map(), reduce(), etc.
- A stream is not a data structure instead it takes input from Collections like arrays.

#2
- Normal for loop iterates over the elements one by one whereas enhanced for loop array itself give a value and that value goes into a variable say n.
- We can also print all the values present in an array by using the forEach method().
- forEach method gives one value at a time and we can save that value in a variable say n and print it.
nums.forEach( n- System.out.println(n));
- forEach method is part of a list interface, that gives one value at a time and then you can perform operations on it.

Github repo : https://github.com/navinreddy20/Javac...

Instagram : Instagram: navinreddyofficial
Linkedin : LinkedIn: navinreddy20
Discord : Discord: discord

Java:- https://bit.ly/JavaUdemyTelusko
Spring:- https://bit.ly/SpringUdemyTelusko

More Learning :

Java  :- https://bit.ly/3x6rr0N
Python  :- https://bit.ly/3GRc7JX
Django  :- https://bit.ly/3MmoJK6

JavaScript :- https://bit.ly/3tiAlHo
Node JS :- https://bit.ly/3GT4liq

Rest Api  :-https://bit.ly/3MjhZwt
Servlet :- https://bit.ly/3Q7eA7k
Spring Framework :- https://bit.ly/3xi7buh
Design Patterns in Java :- https://bit.ly/3MocXiq
Docker :- https://bit.ly/3xjWzLA

Blockchain Tutorial :- https://bit.ly/3NSbOkc
Corda Tutorial:- https://bit.ly/3thbUKa
Hyperledger Fabric :- https://bit.ly/38RZCRB

NoSQL Tutorial :- https://bit.ly/3aJpRuc  
Mysql Tutorial :- https://bit.ly/3thpr4L

Data Structures using Java :- https://bit.ly/3MuJa7S
Git Tutorial :- https://bit.ly/3NXyCPu

Donation:
PayPal Id : navinreddy20
https://www.telusko.com
2 سال پیش در تاریخ 1401/10/28 منتشر شده است.
51,519 بـار بازدید شده
... بیشتر