Java 8 interview Questions - Sum of the values of a Map (2021)

Опубликовано: 27 Февраль 2026
на канале: The Java Developer
249
8

This is second part of the interview series on Java 8 Interview questions.
We will discuss a common Java 8 interview question that covers reduce and mapToInt methods.

Question: Sum of the values of a Map(String, Integer).

Java 8 interview Questions - Part 1
   • Java 8 Interview Questions - Filter employ...  

Java 8 crash course that covers and explains all major features of Java 8:
   • Java 8 Crash Course For Beginners  

I will be adding new videos on Java 8 interview. Subscribe if you are new:
   / @thejavadeveloper  

Timestamps:

0:00 Intro
0:27 Problem statement
1:23 Solution 1 using reduce
5:08 Solution 2 using mapToInt