Most Commonly asked Java8 Stream based Interview Question — Part 2
Published in
4 min readFeb 18, 2023
This part is continuation to the already uploaded Part 1 of Most commonly asked Java 8 Stream Based Interview Question.
This part we will discuss about some more questions that can be asked on that Stream that we use to process a List of Objects of Similar type.
The List of Employee Objects is
public class StreamInterviewQuestion {
static List<EmployeeObject> employeeObjectList = new ArrayList<EmployeeObject>();
public static void main(String[] args) {
employeeObjectList.add(new EmployeeObject(111, "Jeya", 30, "Female", "HR", 2011, 25000.0));
employeeObjectList.add(new EmployeeObject(122, "Polish", 29, "Male", "Sales", 2015, 18500.0));
employeeObjectList.add(new EmployeeObject(133, "Thomas", 26, "Male", "Administartion", 2012, 18700.0));
employeeObjectList.add(new EmployeeObject(144, "Gowthami", 29, "Female", "Development", 2014, 33500.0));
employeeObjectList.add(new EmployeeObject(155, "Nisha", 25, "Female", "HR", 2013, 22000.0));
employeeObjectList.add(new EmployeeObject(166, "Issac", 40, "Male"…