Question: Streams & Text Write a program that does the following: Reads in an integer limit from the STDIN ( through a Scanner ) using .

Streams & Text
Write a program that does the following:
Reads in an integer limit from the STDIN (through a Scanner) using .nextInt()-- don't forget to use .nextLine() after it to reset the cursor to the next line.
Declare a List of String and Read in limit number of sentences into it.
Using a Stream:
1. Declare a new List of String
2. Create a stream.
3. Filter the original List by each item that contains a substring "are"
.filter() will use a lambda expression like: .filter((a)-> a.contains(substring))
4. Collect the matching items into the new List of String, using a method from Collectors
Print them out one by one using System.out.println();
Some useful Stream methods might be: stream(),.filter(), and collect()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!