Stream never modifies the source data, it processes it and gives us the result without modifying the original data.
Java: Beginner Guide to Stream API
a thread...
Stream never modifies the source data, it processes it and gives us the result without modifying the original data.
1. Collection. stream()
2. Stream.of(T... values)
3. Arrays. stream()
4. Stream.builder()
Eg:️

1. Intermediate Operations(IO)
2. Terminal Operations(TO)
Here's what the stream pipeline looks like:
Source -> Intermediate Operations -> Terminal Operations
It returns another stream object, after this, we can either call another IO or TO.
Few methods in Stream API for Intermediate operations:
1. filter()
2. map()
3. sorted()
and many more...
filter() - filters out the data based on any boolean condition - below we're filtering elements starting with the letter a.
map() - performs some given operation on the whole data set - below we're converting every element to upper case.

It's the last operation done on stream that's why it's called terminal.
This operation returns the final result.
Few methods in Stream API for Terminal operations:
1. collect()
2. count()
3. forEach()
and many more...
collect() - collects the elements in the given collection as shown below in the first case it is returning data in the form of a list.
count() - counts the no of the element in the stream and returns in the form of long.

More from Vikas Rajput
Learn Core Java, in 30 days as an Absolute Beginner
a roadmap...
Core Java can be Overwhelming, in the beginning!
Let's see what are those topics you should cover and what you can skip in Core Java.
1. Theoretical Concepts (2 days)
- Features of Java
- JVM, JRE & JDK
- Memory areas in Java
- Basics of how Garbage Collection Works.
2. OOP Concepts (3 days)
- Objects and Classes
- Inheritance
- Polymorphism
- Encapsulation
This topic forms the basis of your Java learning. Spent enough time on this topic and understanding it using real-world examples and some
3. Primitives data types, Operators & Arrays (3 days)
- Various primitives/non-primitives data types, operators
- What is their use, How to use them
- Various sizes of data types
- Arrays, practice a few of its problems
- 2D/3D arrays and their use cases, practice a few problems
a roadmap...
Core Java can be Overwhelming, in the beginning!
Let's see what are those topics you should cover and what you can skip in Core Java.
1. Theoretical Concepts (2 days)
- Features of Java
- JVM, JRE & JDK
- Memory areas in Java
- Basics of how Garbage Collection Works.
2. OOP Concepts (3 days)
- Objects and Classes
- Inheritance
- Polymorphism
- Encapsulation
This topic forms the basis of your Java learning. Spent enough time on this topic and understanding it using real-world examples and some
OOPs Concept in Java
— Vikas Rajput (@vikasrajputin) April 4, 2022
a thread...
3. Primitives data types, Operators & Arrays (3 days)
- Various primitives/non-primitives data types, operators
- What is their use, How to use them
- Various sizes of data types
- Arrays, practice a few of its problems
- 2D/3D arrays and their use cases, practice a few problems
You May Also Like
#ஆதித்தியஹ்ருதயம் ஸ்தோத்திரம்
இது சூரிய குலத்தில் உதித்த இராமபிரானுக்கு தமிழ் முனிவர் அகத்தியர் உபதேசித்ததாக வால்மீகி இராமாயணத்தில் வருகிறது. ஆதித்ய ஹ்ருதயத்தைத் தினமும் ஓதினால் பெரும் பயன் பெறலாம் என மகான்களும் ஞானிகளும் காலம் காலமாகக் கூறி வருகின்றனர். ராம-ராவண யுத்தத்தை
தேவர்களுடன் சேர்ந்து பார்க்க வந்திருந்த அகத்தியர், அப்போது போரினால் களைத்து, கவலையுடன் காணப்பட்ட ராமபிரானை அணுகி, மனிதர்களிலேயே சிறந்தவனான ராமா போரில் எந்த மந்திரத்தைப் பாராயணம் செய்தால் எல்லா பகைவர்களையும் வெல்ல முடியுமோ அந்த ரகசிய மந்திரத்தை, வேதத்தில் சொல்லப்பட்டுள்ளதை உனக்கு
நான் உபதேசிக்கிறேன், கேள் என்று கூறி உபதேசித்தார். முதல் இரு சுலோகங்கள் சூழ்நிலையை விவரிக்கின்றன. மூன்றாவது சுலோகம் அகத்தியர் இராமபிரானை விளித்துக் கூறுவதாக அமைந்திருக்கிறது. நான்காவது சுலோகம் முதல் முப்பதாம் சுலோகம் வரை ஆதித்ய ஹ்ருதயம் என்னும் நூல். முப்பத்தி ஒன்றாம் சுலோகம்
இந்தத் துதியால் மகிழ்ந்த சூரியன் இராமனை வாழ்த்துவதைக் கூறுவதாக அமைந்திருக்கிறது.
ஐந்தாவது ஸ்லோகம்:
ஸர்வ மங்கள் மாங்கல்யம் ஸர்வ பாப ப்ரநாசனம்
சிந்தா சோக ப்ரசமனம் ஆயுர் வர்த்தனம் உத்தமம்
பொருள்: இந்த அதித்ய ஹ்ருதயம் என்ற துதி மங்களங்களில் சிறந்தது, பாவங்களையும் கவலைகளையும்
குழப்பங்களையும் நீக்குவது, வாழ்நாளை நீட்டிப்பது, மிகவும் சிறந்தது. இதயத்தில் வசிக்கும் பகவானுடைய அனுக்ரகத்தை அளிப்பதாகும்.
முழு ஸ்லோக லிங்க் பொருளுடன் இங்கே உள்ளது https://t.co/Q3qm1TfPmk
சூரியன் உலக இயக்கத்திற்கு மிக முக்கியமானவர். சூரிய சக்தியால்தான் ஜீவராசிகள், பயிர்கள்
இது சூரிய குலத்தில் உதித்த இராமபிரானுக்கு தமிழ் முனிவர் அகத்தியர் உபதேசித்ததாக வால்மீகி இராமாயணத்தில் வருகிறது. ஆதித்ய ஹ்ருதயத்தைத் தினமும் ஓதினால் பெரும் பயன் பெறலாம் என மகான்களும் ஞானிகளும் காலம் காலமாகக் கூறி வருகின்றனர். ராம-ராவண யுத்தத்தை

தேவர்களுடன் சேர்ந்து பார்க்க வந்திருந்த அகத்தியர், அப்போது போரினால் களைத்து, கவலையுடன் காணப்பட்ட ராமபிரானை அணுகி, மனிதர்களிலேயே சிறந்தவனான ராமா போரில் எந்த மந்திரத்தைப் பாராயணம் செய்தால் எல்லா பகைவர்களையும் வெல்ல முடியுமோ அந்த ரகசிய மந்திரத்தை, வேதத்தில் சொல்லப்பட்டுள்ளதை உனக்கு
நான் உபதேசிக்கிறேன், கேள் என்று கூறி உபதேசித்தார். முதல் இரு சுலோகங்கள் சூழ்நிலையை விவரிக்கின்றன. மூன்றாவது சுலோகம் அகத்தியர் இராமபிரானை விளித்துக் கூறுவதாக அமைந்திருக்கிறது. நான்காவது சுலோகம் முதல் முப்பதாம் சுலோகம் வரை ஆதித்ய ஹ்ருதயம் என்னும் நூல். முப்பத்தி ஒன்றாம் சுலோகம்
இந்தத் துதியால் மகிழ்ந்த சூரியன் இராமனை வாழ்த்துவதைக் கூறுவதாக அமைந்திருக்கிறது.
ஐந்தாவது ஸ்லோகம்:
ஸர்வ மங்கள் மாங்கல்யம் ஸர்வ பாப ப்ரநாசனம்
சிந்தா சோக ப்ரசமனம் ஆயுர் வர்த்தனம் உத்தமம்
பொருள்: இந்த அதித்ய ஹ்ருதயம் என்ற துதி மங்களங்களில் சிறந்தது, பாவங்களையும் கவலைகளையும்

குழப்பங்களையும் நீக்குவது, வாழ்நாளை நீட்டிப்பது, மிகவும் சிறந்தது. இதயத்தில் வசிக்கும் பகவானுடைய அனுக்ரகத்தை அளிப்பதாகும்.
முழு ஸ்லோக லிங்க் பொருளுடன் இங்கே உள்ளது https://t.co/Q3qm1TfPmk
சூரியன் உலக இயக்கத்திற்கு மிக முக்கியமானவர். சூரிய சக்தியால்தான் ஜீவராசிகள், பயிர்கள்