Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Data Oriented Programming in Java 21 - Solving the Countdown Game

Java via YouTube

Overview

Explore Data Oriented Programming in Java 21 through a practical demonstration of solving the Countdown game. Learn how to leverage new JDK features including Records, Sealed Types, Pattern Matching, Unnamed Patterns, Exhaustive Switches, and Stream API enhancements like mapMulti() and Gatherers. Discover efficient coding techniques as you implement both top-down and bottom-up algorithms, utilize anonymous classes as non-denotable types, and compare different approaches to solve this mathematical puzzle. Gain insights into writing readable, efficient Java code while tackling a fun programming challenge.

Syllabus

Do you feel like a coffee break?
Introducing the Countdown game and its rules
Introducing the Haskell algorithm translated to Java
Computing all the permutations of all the subsets
Splitting the sets to apply the four operations
Filtering the invalid operations
Computing the final result and the string of characters
Using Data Oriented Programming to model the data
Wrapping up this algorithm
Writing a bottom up algorithm leveraging Data Oriented Programming
Using Optional to discard invalid mapping operations
Getting rid of Optional with Stream.mapMulti
Implementing resolve with an exhaustive switch and pattern matching
Using a Gatherer to inserting an element at a specific place in a sorted stream
Using anonymous classes and non-denotable types
Using the Gatherer in the final process
Making the algorithm efficient
Writing the final algorithm using Records
Comparing the two algorithms
That's it for today, talk to you soon!

Taught by

Java

Reviews

Start your review of Data Oriented Programming in Java 21 - Solving the Countdown Game

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.