Java Stream Vs IntStream : Which one for better performance ? | Boxing & Unboxing in Stream API

preview_player
Показать описание
In this video, We will look at the IntStream interface from Stream API. Java allows us to do boxing and unboxing and of course, autoboxing and autounboxing but, Does Stream API in java allows this ?

Can we convert a Stream of Integers to primitive int's ? Do we have boxing and unboxing concept in Stream API as well ?

That's something we are going to explore in this video.

In this video, We will learn the following topics :
1) Boxing and Unboxing in java
2) The IntStream
3) Difference between Java Stream Vs IntStream
4) Boxing and Unboxing in Stream API.

Timestamp
-----------------
00:00 - Today's Java Stream Topic
02:15 - What is boxing in Java ?
04:25 - What is auto boxing in java ?
07:40 - What is Auto Unboxing in java ?
09:56 - What is unboxing in java ?
13:46 - IntStream for primitive int
17:35 - IntStream : For better performance ?
20:52 - Int vs Integer : Memory Analysis
23:48 - IntStream : sum,min,max,avg
25:23 - OptionalInt
29:31 - Introducing reduce() of Stream API
33:37 - How reduce method in Stream API works ?
46:10 - Unboxing in stream api
49:32 - mapToInt()
50:40 - ToIntFunction
59:15 - Boxing in Stream API
01:00:05 - range vs rangeClosed
01:02:11 - boxed() in Stream
01:08:47 - Assignment
01:11:20 - What's Next ?

For more free/paid courses visit

LINKS AND FREE LEARNING RESOURCES
========
Watch my new mock interview series for java developers

Watch my new Hello spring boot series

Watch Spring boot Hot topics

spring core

spring mvc

spring mvc intermediate

Spring JDBC

spring live project

SPRING SECURITY COURSE[NEW]

For more courses visit

Any time you are getting stuck with issues, Feel free to ask for support.

you can ping me on my Facebook page

Make sure to join my private Facebook page (Ask me here)
“SeleniumExpress - Support"

you can ask for support in my website forum

Follow me on Insta
Рекомендации по теме
Комментарии
Автор

Thank you so much Abhilash, for this session, i will always pray for your channel to get millions of subscribers. Thank you so much for providing brilliant content for free. So much of respect for you.

Hari
Автор

Thank you for being grateful for the explanation.
Integer[] integers = new Integer[]{1, 2, 3, 4, 5};
Stream<Integer> integerStream = Arrays.stream(integers);

int[] ints = new int[]{1, 2, 3};
IntStream intStream = Arrays.stream(ints);

govindarajv
Автор

Bhai ur teaching style is very much good and I feel good when I searh any topic and I got ur video hats off to u😊

bipinsingh
Автор

Waiting for your parallel stream video eagerly 😘

rahulbhatanagar
Автор

Great session! :)
Thank you for great insights.😃💯

taterrahul
Автор

My day start with Selenium, end's with know knowledge from selenium .... Stunning movement for us ❤❤❤❤

Krishwithniece
Автор

Thanks #selenium express for sharing Stream API ad Java Lambdas, just want to know when new videos you will release about parallel stream, flatMap and stuff from stream api, Thanks!

ravi
Автор

Hi Abhilash, it feels good watching your videos again but this time, I have dev job :D

lunatichigh
Автор

Please make similar kind of video for char and string in stream api

dhananjaygavnang
Автор

Sir please for god sake do a playlist on the important features from java 9 to the LTS Java 21

abilash.m
Автор

Assignment answer:
whenever take Integer wrapper class like
Integer[]integer1= new Integer[] {1, 2, 3, 4, 5, 6};

Arrays.stream(T[] array);
(this method will return as we provide particular object(like Integer, Double, Float, Long))
Example : return -->Stream<T>

But take int primitive type instead of wrapper class // like
int[]intStream= new int[] {1, 2, 3, 4, 5, 6};
Arrays.stream(int[] array);
(here return particular primitive type of Stream like..int, short,float,long) // //
Example : return--->IntStream, LongStream, DoubleStream
correct me if am i wrong..

Krishwithniece
Автор

Hi sir, Can you let me know how to do if a stream has both int and float values at 54.10

vcloudxpert
Автор

Why introduce primitive and wrapper class at same time. ...? I know primitive faster than wrapper classes and generics used to use objects only that's wrapper classes will be use here.. But my doubt was same functionality why introduce two ways...?

Krishwithniece
Автор

Output will be zero, It was easy guess😁

rahulbhatanagar
Автор

Integer[] integers= new Integer[]{1, 2, 3};
Stream<Integer> stream = Arrays.stream(integers);

int[] ints= new int[]{1, 2, 3};
IntStream stream1 = Arrays.stream(ints);

nehatiwari
Автор

Integer[] arr1 = new Integer[] {1, 2, 3, 4, 5};
Stream<Integer> stream = Arrays.stream(arr1);

int[] arr2 = new int[] {1, 2, 3, 4, 5};
IntStream stream2 = Arrays.stream(arr2);

ashutoshgupta