Check out our courses:
Java Full Stack and Spring AI - go.telusko.com/JavaSpringAI
Coupon: TELUSKO10 (10% Discount)
DevOps with AWS: From Basics to Mastery : go.telusko.com/DevOpsAWS
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : go.telusko.com/masterjava
Coupon: TELUSKO20 (20% Discount)
For More Queries WhatsApp or Call on : +919008963671
Udemy Courses:
Spring: go.telusko.com/udemyteluskospring
Java:- go.telusko.com/udemyteluskojava
Java Spring:- go.telusko.com/Udemyjavaspring
Java For Programmers:- go.telusko.com/javaProgrammers
Python : go.telusko.com/udemyteluskopython
Git : go.telusko.com/udemyteluskogit
Docker : go.telusko.com/udemyteluskodocker
website : 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 : github.com/navinreddy20/Javacode.git
Instagram : www.instagram.com/navinreddyofficial/
Linkedin : in.linkedin.com/in/navinreddy20
Discord : discord.gg/UrYda98D
Java:- bit.ly/JavaUdemyTelusko
Spring:- bit.ly/SpringUdemyTelusko
More Learning :
Java :- bit.ly/3x6rr0N
Python :- bit.ly/3GRc7JX
Django :- bit.ly/3MmoJK6
JavaScript :- bit.ly/3tiAlHo
Node JS :- bit.ly/3GT4liq
Rest Api :-bit.ly/3MjhZwt
Servlet :- bit.ly/3Q7eA7k
Spring Framework :- bit.ly/3xi7buh
Design Patterns in Java :- bit.ly/3MocXiq
Docker :- bit.ly/3xjWzLA
Blockchain Tutorial :- bit.ly/3NSbOkc
Corda Tutorial:- bit.ly/3thbUKa
Hyperledger Fabric :- bit.ly/38RZCRB
NoSQL Tutorial :- bit.ly/3aJpRuc
Mysql Tutorial :- bit.ly/3thpr4L
Data Structures using Java :- bit.ly/3MuJa7S
Git Tutorial :- bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
www.telusko.com/
コメント