what are benefits of using aggregate operations oncollection streams for processing data?
Answer
When we use Collections to store objects in our programs, wegenerally need to do more than simply put the objects in thecollection — we need to store, retrieve, remove, and update theseobjects. Aggregate operations use lambdas to perform actions on theobjects in a Collection. For example, you can use aggregateoperations to:
- Print the names of all the servers in inventory from aparticular manufacturer
- Return all of the servers in inventory older than a particularage
- Calculate and return the average age of Servers in yourinventory (provided the Server object has
OROR