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:
Declare a new List of String
Create a stream.
Filter the original List by each item that contains a substring "are"
filter will use a lambda expression like: filtera acontainssubstring
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: streamfilter and collect
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
