1. Learn
  2. /
  3. Courses
  4. /
  5. Input/Output and Streams in Java

Connected

Exercise

Filtering and counting emails for customer engagement

A marketing team wants to count the number of customers with company email addresses (emails ending in @company.com) to send promotional offers. Streams allow us to filter and count these email addresses efficiently.

Instructions

100 XP
  • Convert the emails list into a Stream object.
  • Filter only emails ending with @company.com.
  • Count how many emails match the condition.