11.Find the average salary of each department using stream APIs | Java coding interview questions
ฝัง
- เผยแพร่เมื่อ 15 ก.ย. 2024
- In this video, we solved below problem statement using Java stream APIs
Problem statement - Find the average salary of each department using java8 stream APIs
Employee class -
name;
department;
salary;
Input - employees = Arrays.asList(
new Employee("Alice", "HR", 50000),
new Employee("Bob", "IT", 60000),
new Employee("Charlie", "HR", 70000),
new Employee("David", "IT", 75000),
new Employee("Eve", "Finance", 80000),
new Employee("Frank", "Finance", 85000));
Output -
Department: Finance, Average Salary: 82500.0
Department: HR, Average Salary: 60000.0
Department: IT, Average Salary: 67500.0
For Complete Java Interview Preparation Watch this Playlist:
• 🔥Java Interviews🔥
For complete list of stream apis coding interview questions:
• 🔥Java Coding using Str...
You can share your interview experience with us on practicelab23@gmail.com
Also if you need assistance to crack the interviews, please connect us at practicelab23@gmail.com