1. Học hỏi
  2. /
  3. Khoa Học
  4. /
  5. Input/Output and Streams in Java

Connected

Bài tập

Processing usernames for display

In a user management system, we need to display usernames stored in a database. Using Streams and .forEach(), we can efficiently process and print each username without using traditional loops.

All the necessary classes from java.util have been imported for you.

Hướng dẫn

100 XP
  • Convert the usernames list into a Stream object.
  • Print each element in the stream using a lambda expression.