
Discover the essentials of functional programming in Java, using the Java 8 library and lambda expressions to work with collections, filters, and design improvements via the strategy pattern.
Explore functional programming as a programming paradigm and style of coding that uses functions, immutable data, and a declarative approach, complementary to object-oriented programming.
Discover why functional programming benefits Java developers, using lambda expressions and pure functions with immutable data to improve readability, testability, and parallelism with RxJava.
Explore Java functional interfaces, which have one abstract method like apply, support default methods, and replace verbose anonymous classes and Runnable implementations with concise lambda expressions to simplify code.
Explore java's functional interfaces - consumer, supplier, predicate, and function. See how each defines an operation, with apply, test, or accept as abstract methods, and how supplier's get enables laziness.
Learn to iterate a list of strings in Java using internal iterators with forEach, a consumer, and lambda expressions or method references for cleaner, parallelizable code.
Transform a list into an uppercase collection using an immutable pack and a for-each iterator, highlighting inline operations and verbosity, with a tease of using streams in the next lesson.
Learn to use stream objects on collections to transform elements with map, convert them to uppercase, and print results in a concise, single-line approach.
Learn to find elements in a collection using Java streams: filter with a predicate to select names that begin with A, then collect results into a list with collectors.
Learn how to store a lambda expression as a final predicate object for strings and reuse it across collections with the filter method, avoiding duplication.
Leverage lexical scope to create a function that returns a predicate, enabling reusable criteria for filtering collections and avoiding duplicated lambda expressions in Java functional programming.
Learn to use the Java function interface to narrow scopes by returning a string predicate from a lambda, and apply it in a filter method to demonstrate nested lambdas.
Learn to compose nested lambda expressions and predicates in Java, using streams, filter, and count to tally names and handle long return values.
Learn how the optional interface in Java 8 streams prevents null pointer errors when finding the first name starting with a given letter, using ifPresent and orElse.
Explore using the optional class to guard against null values, then leverage streams to filter and find the first matching element, with or else and is present for conditional actions.
this lecture demonstrates the reduce operation to turn a list into a single result by mapping elements to their length and summing them.
Use the reduce function on a stream to find the longest element in a list by comparing two elements with an associative accumulation function, returning an optional single result.
Learn to join list elements with a comma and space using string join, then filter by names starting with a, and assemble the final output with collectors.joining on a stream.
Explore iterating string objects in Java functional programming with streams, using chars, for each, and map to transform values into characters, guided by lambda expressions and method references.
Sort objects by age in Java functional programming using streams, a person class with name and age, and an age difference comparator to produce an ascending list.
Explore the Java comparator interface, implementing its compare method with lambda expressions, and learn how reversing parameter order yields descending sorts; future lessons cover inverted order and more complex interfaces.
Reverse the sorting order with the reversed comparator on a lambda-based comparator for two persons. Compare by name using string compare, and note that min and max return optional objects.
Sort by multiple criteria using a function interface and the comparing function, first by name then by age, with optional reverse order and age cast to int.
Master the collect method in Java functional programming, exploring its variations with supplier, accumulator, and combiner to build containers like array lists, maps, or sets, using method references and parallelism.
Group the list of person objects by age into a map using Collectors.groupingBy, then optionally sort by name and collect the results into groups.
Group by age and map to lists of names using grouping by and mapping collectors, transforming a list of persons into a map of age to lists of names.
Group elements by their first character. Reduce each group to the oldest person using a max by age comparator and optional results.
Learn to list all files in the current directory in Java using Files.list and a stream, printing each with forEach and a method reference, with io exception handling.
Convert directories into a stream, filter for directories using isDirectory, and display the content to prepare for selecting a file.
Selects only Java files from a directory by applying a filter with the list method and directory stream, showcasing one-line and multi-step approaches with lambdas.
Learn how to pick hidden files in Java using a directory stream with a filter and the list files method, converting paths to files and applying a hidden property.
Learn how to convert a directory or file into a stream in Java functional programming, enabling map, filter, and stream operations, and collect those streams into a list using Stream.of.
Explore separating concerns in a simple asset class using streams, map, and sum to address three concerns (iterate, what to iterate, and how to sum) for stock and other assets.
Apply a predicate and the filter method to filter assets by type, separating the key concern; add a second parameter with a type check to print the filtered results.
Delegate stock price lookup to a price finder function interface using a lambda, separating the web service from the calculation. This enables testing with mock finders before real service integration.
Learn the essentials of functional programming as an introduction. Explore the recommended book to deepen your understanding, including resources, laziness, and recursion limitations, then pursue reactive programming.
this course will teach you the following Parts of Functional Programming:
Getting to know the concept: we will answer to the questions of What is Functional Programming and why should we use it.
How to use Lambda expressions on Collections: collections are a very important part of JAVA and every developer is concerned with it so in this course we will discover how you can use lambda expressions to improve your usage of java collections.
How to use Comparators and Filters: complex operations like filtering and comparing data is made very easy like never using lambda expressions with some quiet beautiful utilities offered by JDK.
How to design with lambda expressions: if you are designing your applications using strategy pattern (which makes you handling more and more hierarchy problems), lambda expressions is made for you to minimize the complexity generated by the hierarchy of your classes and interfaces.