Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Filtering Corporate Email Addresses | Section
Stream API in Java
close
Section 1. Chapter 5
single

single

bookChallenge: Filtering Corporate Email Addresses

Swipe to show menu

Task

Swipe to start coding

You have a list of employee email addresses, and you need to keep only the corporate emails (those ending with @company.com).

  1. Implement a Predicate to filter corporate emails that end with @company.com.
  2. Pass the correct parameters to the filterEmails method.
  3. In the filterEmails method, iterate through all email addresses using a for-each loop.
  4. Apply the Predicate in the if condition.
  5. Add the matching emails to the new list result.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 5
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

some-alt