Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lära Challenge: Filtering Corporate Email Addresses | Fundamentals and Functional Capabilities of Stream API
Stream API

book
Challenge: Filtering Corporate Email Addresses

Uppgift

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.

Lösning

solution.java

solution.java

Var allt tydligt?

Hur kan vi förbättra det?

Tack för dina kommentarer!

Avsnitt 1. Kapitel 5
single

single

Fråga AI

expand

Fråga AI

ChatGPT

Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal

some-alt