Workbook 13.7
From the Java Bootcamp Resources
, launch starter.
Task 1
Use Files.lines(path)
to create a stream of String
elements from the data source.
Task 2
Process the stream in a pipeline of operations:
1. filter
: uses the method startsWith
to remove Spam
emails.
2. forEach()
: prints every element in the stream.
>>: Primary: Just checking in, how was your weekend?
>>: Social: You have been invited to join the DEF group!
>>: Social: You have been invited to join the ABC network!
>>: Social: You have been added to the ABC group!
>>: Primary: I hope you're doing well!
>>: Primary: Just wanted to catch up, how have you been?
>>: Primary: Hi, how are you doing?
>>: Promotions: 20% off all shoes!
>>: Promotions: Get a free gift with your next purchase!
>>: Social: You have been invited to join the XYZ network!
>>: Social: You have a new follower on XYZ!
>>: Primary: How has your week been going?
>>: Promotions: 50% off your first purchase!
>>: Promotions: 10% off your next vacation!
>>: Promotions: New clearance sale at XYZ store!
Associated Course: The Complete Java Development Bootcamp
Related Course: The Complete Spring Boot Development Bootcamp – Become a Java Web Developer
Feedback Summary
4.7
43 students
5
91%
4
2%
3
0%
2
0%
1
7%
Written Reviews
There are no written reviews yet.