Java Streams Interview Question - 01 - Print Sum Of All Numbers

preview_player
Показать описание
Java Streams Interview Question - 01 - Print Sum Of All Numbers

Schedule a meeting in case of any queries/guidance/counselling:

~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:

Follow me on my Facebook Page:

Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:

Naveen AutomationLabs Paid Courses:
GIT Hub Course:

Java & Selenium:

Java & API +POSTMAN + RestAssured + HttpClient:
Рекомендации по теме
Комментарии
Автор

Thanks Naveen for making short videos on the latest features of Java JDK 1.8.It really saves a lot of time and also helps to stay updated and adds to our knowledge.Thanks

soumyajit
Автор

For me, Naveen is the another name of oxygen..god bless you Naveen...

Uni_Dynamic
Автор

Grate tutorial... adding my worth of penny

List<Integer>list = Arrays.asList(1, 4, 5, 6, 1, 4);
int sum3 = list.stream().mapToInt(i -> i).sum();
System.out.println("Sum of numbers ::" + sum3);

nikunjpatel
Автор

Aaj pura video series dekh dalunga wd code 😊👍nice video series 😊

pratapjavasingh
Автор

Thanks a lot for making this video…waiting for this from long time

prajwalgowda
Автор

Thanks for the video Naveen.... could you pls let me know how to get count of duplicate characters present in String for ex: a:4, b:5 times

santooveluri
Автор

Your answer is correct but you have used extra memory. Storing an object requires more memory. Then why use stream?.
Even with your example you could have created IntStream instead of Stream. Or you could do this
List<Integer> integers = Arrays.asList(1, 2, 3, 4, 5);

binaramani
Автор

what was the reason to convert list of integers to array list ?

yashuverma
Автор

what is the time complexity for this is it same as o(n) ?

jayeshdalal
Автор

please Naveen Give me Some Eclipse Shortcuts for Java Developers

saikumarperamsetty
Автор

hi naveen, any github repository Link ??

deependra
Автор

Thanks for video. Is it ok if I write this kind solution?
List<Integer> list = Arrays.asList(2, 6, 2, -9, 2, 45, 33, 21, 3, 8, 22, -63);
int sum = 0;
for (Integer num : list) {
sum += num;
}
System.out.println("sum of numbers: " + sum);

sorboni.