Ask Question

Create a public non-final class named Streamer. You should implement one class method: filterStrings. It should accept a single parameter: a Stream of Strings (Stream). It should also return a Stream of Strings, but: only those that are longer than 8 characters and with each member of the stream converted to lowercase You may want to review yesterday's lecture and Java's official stream documentation, in particular the map and filter functions. You will need to import java. util. stream. Stream. Do not terminate the stream: simply return it from your function.

+3
Answers (1)
  1. 31 December, 01:01
    0
    See explaination

    Explanation:

    / Streamer. java

    import java. util. stream. Stream;

    public class Streamer {

    //required method

    public static Stream filterStrings (Stream stream) {

    //filtering out the strings from stream where length is less than or

    //equal to 8, and then converting all strings in the resultant stream

    //to lower case using map ()

    stream = stream. filter (e - > e. length () > 8). map (String::toLowerCase);

    return stream;

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Create a public non-final class named Streamer. You should implement one class method: filterStrings. It should accept a single parameter: ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers