Question: Counting Filtered Data Take Two Following the DRY Principle, use the code example below startsWithS and modify it to be more generic. Write a new

Counting Filtered Data Take Two
Following the DRY Principle, use the code example below startsWithS and modify it to be more generic. Write a new static method called startsWithLetter(String Letter)
final Predicate startsWithS = name -> name.startsWith("S");
Steps
Write a static method what takes a String letter as a parameter, and returns the name if it starts with the letter passed in.
Use public static Predicate startsWithLetter(String letter), and return a Lambda Expression in the method.

Step by Step Solution

3.49 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is the modified code following the DRY principle by creating a generic method startsWith... View full answer

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 Programming Questions!