Question: What is the output of this programming code? Stream . of ( new Employee ( 1 , Ahmad, IT , 1 2 0

What is the output of this programming code?
Stream
.of(new Employee(1, "Ahmad", "IT",1201.2), new Employee(2, "Sami", "Sales", 990.2), new Employee(5, "Huda", "IT",880.2), new Employee(7, "Ali", "Marketing", 900.2), new Employee(4, "Hani", "Sales", 1050.2))
.filter(e-> e.getSalary()>1000)
.sorted(Comparator.comparing(Employee::getSalary))
.map(e -> e.getName()+": "+ e.getSalary())
.forEach(str-> System.out.print(str +","));
Ahmad: 1201.2, Hani: 1050.2,
Ahmad: 1201.2, Hani: 1050.2, Sami: 990.2, Ali: 900.2, Huda: 880.2,
Hani: 1050.2, Ahmad: 1201.2,
Huda: 880.2, Ali: 900.2, Sami: 990.2, Hani: 1050.2, Ahmad: 1201.2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!