Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Finding the Top 3 Hardest-Working Employees | Intermediate Operations in Stream API
Stream API

bookChallenge: Finding the Top 3 Hardest-Working Employees

Tehtävä

Swipe to start coding

Several employees work at the factory, and we need to identify the three hardest-working employees based on the number of hours worked.

  1. Sort the list of workers in ascending order by the number of hoursWorked using the comparingInt() method.
  2. Reverse the list of workers to make it descending by the number of hoursWorked using the reversed() method.
  3. Select the top three workers with the highest hoursWorked using the limit() method.
  4. Print each of these three workers to the console.

Ratkaisu

solution.java

solution.java

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 2. Luku 10
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

Awesome!

Completion rate improved to 2.33

bookChallenge: Finding the Top 3 Hardest-Working Employees

Pyyhkäise näyttääksesi valikon

Tehtävä

Swipe to start coding

Several employees work at the factory, and we need to identify the three hardest-working employees based on the number of hours worked.

  1. Sort the list of workers in ascending order by the number of hoursWorked using the comparingInt() method.
  2. Reverse the list of workers to make it descending by the number of hoursWorked using the reversed() method.
  3. Select the top three workers with the highest hoursWorked using the limit() method.
  4. Print each of these three workers to the console.

Ratkaisu

solution.java

solution.java

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

close

Awesome!

Completion rate improved to 2.33
Osio 2. Luku 10
single

single

some-alt