What's New in Java 8
A quick overview of most of the new features of Java 8. The course covers lambda expressions and the Stream API but also many new additions scattered all around the JDK. JavaFX and Nashorn are also quickly covered.
What you'll learn
This course covers the most useful parts of Java 8. This update of the Java platform is the biggest of all. It's even bigger than Java 5 that saw the introduction of generics. We'll begin with lambda expressions and the Stream API, which bring new fundamental patterns to the Java platform. Many problems solved with the Iterator pattern are now solved much more efficiently with the patterns brought by the Stream API. But Java 8 is not only about lambdas, streams and collectors, there is also a new Java Date and Time API which are covered in this course. This API fixes all the flaws of the previous Date/Calendar API and brings new, very useful, concepts and tools. Many new features that bring a functional programming approach have been added to the Collection API. This is also covered in detail. Many more things are covered; little things, scattered here and there in the JDK, like this new StringJoiner class, useful to join strings with a prefix, a postfix, and a separator. JavaFX and Nashorn are also quickly covered, to show the FXML way to describe Graphical User Interfaces, and the new ways to describe JavaFX in Javascript using Nashorn.
Table of contents
- Introduction, Targeted Audience 3m
- Module Outline 1m
- The FileFilter Example 3m
- A First Lambda Expression 3m
- Live Coding: A First Lambda Expression 3m
- Live Coding: Runnable and Comparator Examples 4m
- Several Ways of Writing Lambda Expressions 1m
- Three Questions About Lambda Expressions 1m
- Functional Interfaces 5m
- Is a Lambda Expression an Object? 4m
- The Functional Interfaces Toolbox 5m
- Method References 3m
- Processing Collections with Lambdas 2m
- Changing the Way Interfaces Work? 3m
- Default and Static Methods in Java 8 Interfaces 2m
- New Patterns: The Predicate Interface Example 3m
- Live Coding: New Patterns Examples 3m
- Module Wrap Up 1m
- Version Check 0m
- Introduction, Module Outline 1m
- The Map / Filter / Reduce Algorithm 3m
- What Is a Stream? 3m
- Definition of a Stream in Java 8 4m
- Building and Consuming a Stream 3m
- Filtering a Stream 4m
- Live Coding: Consuming and Filtering a Stream 3m
- Lazy Operations on a Stream 5m
- Live Coding: Intermediary and Terminal Operations 3m
- Wrapping up Intermediary and Terminal Operations 1m
- The Map Operation 2m
- The Flatmap Operation 1m
- Live Coding: Map and Flatmap Examples 4m
- Wrapping up Map and Filter on a Stream 0m
- Reduction, Functions, and Bifunctions 2m
- Reduction of the Empty Set: Identity Element 2m
- Optionals 3m
- Pattern for the Optionals 1m
- Wrapping up Reduction Operations 1m
- Terminal Operations 3m
- Live Coding: Reductions, Optionals 6m
- Wrapping up Operations and Optionals 1m
- Collectors, Collecting in a String, in a List 2m
- Collecting in a Map 2m
- Live Coding: Processing Streams 9m
- Wrapping Module 3m
- Introduction and Outline 2m
- The Old java.util.Date API 2m
- Why Does Immutability Matter? 4m
- The Instant Class and the Duration Class 4m
- The LocalDate Class and the Period Class 3m
- Live Coding: Local Dates and Periods Examples and Corner Cases 6m
- Computing Dates from Other Dates 2m
- The LocalTime Class 1m
- Dealing with Time Zones: The ZonedTime Class 3m
- Printing Dates and Times: The DateTimeFormatter 1m
- From Legacy Code to the New Date and Time API 2m
- Conclusion and Wrap Up 1m
- Introduction and Outline 3m
- Strings and StringJoiner 7m
- Java I/O: Reading Text Files 4m
- Java I/O: Exploring Directories 2m
- New Methods on Iterable, Collection, and List 4m
- Comparator: Patterns and Utilities 5m
- Numbers, Method References, and Hashcodes 3m
- Map: Enhancements of Existing Methods 4m
- Map: The Compute and Merge Methods 5m
- Live Coding: General Map Enhancements 3m
- Live Coding: Map Merging 4m
- Live Coding: Building Bimaps 6m
- Annotations 3m
- Conclusion and Wrap Up 2m
- Introduction and Outline 3m
- First Key Concepts on a Simple Example 2m
- Live Coding a Hello World Example 2m
- Setting up an Interface Using the JavaFX API 2m
- Setting up an Interface Using the FXML File 5m
- Controller and Dependency Injection 3m
- Live Coding: Setting up a UI with FXML and Java Controllers 10m
- Conclusion and Wrap Up 2m