Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA) Please Solve this one. I need output too. Thank you All of info what I can give is in the picture. I also got

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

JAVA) Please Solve this one. I need output too. Thank you

All of info what I can give is in the picture. I also got that picture. I can't give anymore info. Sorry. My request is all thing in the picture. I just need output. Thank you.

Lambda Expressions Complete the following List Processor class. The Predicate, Consumer, and Function are three functional interfaces as shown below. Class List Processer { //filter method takes a List of items and returns a List of items that satisfies //Predicate public static List filter(List, Predicatep) { //Complete the method //forEach method takes a List of items and executes the Consumer method for //every item in the List. public static void forEach(List, Consumer c) { //Complete the method } //map method takes a List of items and the Function, runs the Function for //every item in the List, and returns a List that contain the returns value from the //Function public static List map(List list, Function f) //Complete the method } } @functionalInterface public interface Predicate{ boolean test(Tt) } @functionalinterface public interface Consumer{ void accept(Tt) } @functionalinterface public interface Function{ Rapply(Tt) } A) Create an IntegerListProcessor class that creates ArrayList of 25 random Integers between 0 and 1000. Using the IntegerListProcessor and appropriate (i) Methods that implement the functional interface and (ii) lambda expressions do the following: Print the list of all the numbers. Print the sum of all numbers. Print all the prime numbers Print the squares of all numbers in the list. Print the list of numbers between any two numbers x and y. B) Create DateListProcessor that creates an ArrayList of 10 Date objects. Use a range of -50 to +50 for the coordinates x and y. Use the GregorianCalendar to create random dates. You can random numbers to generate the dates. Using the IntegerListProcessor and appropriate (i) Methods that implement the functional interface and (ii) lambda expressions do the following: Print all the Date objects. Sort and print the Date objects. Print the Date objects that are after a given date. Print all the dates within a given range of dates. Print all the dates non in a given range of dates

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions

Question

What is advantage of LBO?

Answered: 1 week ago

Question

What is the purpose of the Salary Structure Table?

Answered: 1 week ago

Question

What is the scope and use of a Job Family Table?

Answered: 1 week ago