Coder Social home page Coder Social logo

2022_devnexus-lab's Introduction

Notes

Records

Simple Records

This first set of exercises shows you the first basic elements you need to know on records:

  • how you can create a record class,
  • how you can add a custom constructor,
  • how you can make a record comparable and sort records in a list,
  • how you can add some validation rules on your records.

Less Simple Records

This second set makes you create a Range record, that implements the Iterable interface and some validation rules.

Harder Records

This third set makes you use defensive copy to ensure the immutability of the internal state of your record. A record may be built on mutable components, that should be copied when you create your record, and when you return the value of such a component.

It then makes you create your own equals() and hashCode() methods to define your own record identity.

Hard Records

This fourth set makes you analyze a CSV text file containing US cities, along with several information. You will map each line of this file in a City record and compute various things on the list of cities that you will get:

  • sort them in the alphabetical order,
  • find the city with the largest population,
  • find the states references in this file,
  • then build the histogram of the population per state,
  • and lastly find the most populated state. This set makes you use records with the Stream API.

Challenge Records

This last set of exercises invites you to rewrite the code of the previous set, using records everywhere you can use them. Creating a record is (almost) free and can greatly improve the readability of your core, especially when you are writing complex data processing algorithms.

2022_devnexus-lab's People

Contributors

josepaumard avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.