section-engineering-education / engineering-education

“Section's Engineering Education (EngEd) Program is dedicated to offering a unique quality community experience for computer science university students."
Apache License 2.0
364 stars 890 forks source link

How To Use Lambdas To Manipulate Through A Collection of Objects In Java. #3729

Closed kingsleynwafor54 closed 2 years ago

kingsleynwafor54 commented 3 years ago

In this tutorial I will taking you through journey of how you can use lambdas to manipulate an object an make it look like a functional program. You don't need to loops as in when you hard code you works yourself, in this tutorial you will learn how to sort, map, how get get an object based on any element

Lambdas has different inbuild functions that helps you compare object and also make some calculations .Instead of creating a different array for calculating and storing ,lambdas help you create different pipelines and still maintain the initial data and also gives you the processed data. Imagine you have a mock repository with HashMap and you want to get objects that you have stored based on their account number or better still you want to get the first person that bears the name Kingsley or the name of departmental heads ,writing a for loop might lead to error and it won't be scalable and the performance will be low.

Key take-way is will will learn how to search through object and get any particular kind of information without any array index out of bound, the performance of your system will be scalable, you will also learn how to sort ,and get element based on your own terms and how to blend functional programming with Object Oriented Programming. My reference material is a textbook How to program Java 10Edition by Deitel Deitel.

WanjaMIKE commented 3 years ago

Good afternoon and thank you for submitting your topic suggestion. @kingsleynwafor54 Your topic form has been entered into our queue and should be reviewed (for approval) as soon as a content moderator is finished reviewing the ones in the queue before it.

hectorkambow commented 3 years ago

@kingsleynwafor54 Sounds like a helpful topic - lets please be sure it adds value beyond what is in any official docs and/or what is covered in other blog sites. (the articles should go beyond a basic explanation - and it is always best to reference any EngEd article and build upon it).

Please be attentive to grammar/readability and make sure that you put your article through a thorough editing review prior to submitting for final approval. (There are some great free tools that we reference in EngEd resources.) ANY ARTICLE SUBMITTED WITH GLARING ERRORS WILL BE IMMEDIATELY CLOSED. Please be sure to double check that it does not overlap with any existing EngEd articles, articles on other blog sites, or any incoming EngEd topic suggestions (if you haven't already) to avoid any potential article closure, please reference any relevant EngEd articles in yours. - Approved