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

Coursera

Modern Java - Mastering Features from Java 8 to Java 21

Packt via Coursera

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
This course features Coursera Coach! A smarter way to learn with interactive, real-time conversations that help you test your knowledge, challenge assumptions, and deepen your understanding as you progress through the course. Unlock the power of modern Java by mastering key features introduced from Java 8 through Java 21. This course guides you through fundamental and advanced concepts like lambdas, streams, functional interfaces, new date/time APIs, enhanced switch statements, sealed classes, pattern matching, and modular programming, empowering you to write cleaner, more efficient Java code. Starting with the essentials of Java setup and the importance of Java 8, you will progressively dive into lambda expressions and the Streams API with numerous hands-on labs to solidify learning. The journey continues with explorations of method references, local variable type inference, records, sealed classes, and the newest HTTP client alongside real-world project examples for practical understanding. Ideal for Java developers eager to update their skills or programmers transitioning to modern Java, this course assumes basic Java knowledge but builds toward advanced usage. Whether you're enhancing existing applications or architecting new ones, this course is designed to elevate your Java expertise from intermediate to advanced levels.

Syllabus

  • Getting Started
    • In this module, we will introduce you to the course framework and outline the key Java features from Java 8 to Java 21 that you will master. You will also review the pre-requisites, ensuring you have the necessary foundation and tools to succeed. This section sets the stage for an efficient and productive learning experience.
  • Getting Started Modern Java
    • In this module, we will explore the big picture of modern Java, tracing its evolution from Java 8 to Java 21. You will gain insight into why these features matter and how they impact programming practices today. This foundational overview prepares you for deeper dives in subsequent modules.
  • Local Set Up
    • In this module, we will guide you through installing Java and setting up your development environment. By the end, you'll be ready to write and run Java programs locally. This hands-on setup ensures you can follow along with the practical labs throughout the course.
  • Why Java 8?
    • In this module, we will uncover why Java 8 is a landmark release that revolutionized Java development. You will contrast imperative and declarative programming styles with practical examples, building a solid understanding of the shift that modern Java embraces.
  • Introduction to Lambda
    • In this module, we will introduce lambda expressions and their importance in writing concise Java code. You will get hands-on experience implementing common interfaces like Runnable and Comparator with lambdas, enhancing your functional programming skills.
  • Lambdas and Functional Interfaces
    • In this module, we will explore the core functional interfaces integral to Java’s lambda expressions. Through progressive labs, you will practice using Consumer, Predicate, Function, and other interfaces to write clean, functional-style Java code.
  • Constructor and Method References
    • In this module, we will deepen your understanding of concise coding by exploring method references. You will practice transforming lambda expressions into method and constructor references to write clearer, more readable Java programs.
  • Lambdas and Local Variables (Effectively Final)
    • In this module, we will examine how local variables behave inside lambda expressions. You will learn about the importance of effectively final variables and their benefits, enabling you to avoid common pitfalls when writing lambda-based code.
  • Streams API
    • In this module, we will introduce the Streams API as a powerful tool for functional-style data processing. You will understand how streams work behind the scenes and explore their advantages over conventional collection handling.
  • Stream API - Operations
    • In this module, we will engage with a wide range of stream operations through practical labs. You will transform, filter, sort, and reduce data streams, mastering the key techniques to leverage streams for efficient data manipulation.
  • Streams API - Factory Methods
    • In this module, we will focus on stream creation using factory methods. You will learn how to generate streams from various sources and patterns, equipping you to start stream-based processing in diverse contexts.
  • Streams API - Numeric Streams
    • In this module, we will explore numeric streams designed for efficient processing of primitive data types. You will perform common statistical calculations and transform between different stream types to optimize performance.
  • Streams API - Terminal Operations
    • In this module, we will delve into terminal operations that conclude stream pipelines. You will learn how to collect, group, partition, and summarize data effectively using the Streams API's rich set of collector utilities.
  • Streams API - Parallel Processing
    • In this module, we will introduce parallel streams as a means to leverage multi-core processors. You will build parallel pipelines, analyze their behavior, and understand when to use or avoid parallelization for optimal results.
  • Optional
    • In this module, we will introduce the Optional class as a robust alternative to null handling. You will learn how to create Optionals, safely retrieve values, and transform them with functional operations to write safer, cleaner code.
  • Default/Static Methods in Interfaces
    • In this module, we will explore the enhanced capabilities of interfaces with default and static methods. Through practical labs, you will implement these methods, handle multiple inheritance scenarios, and understand their impact on interface design.
  • New Date/Time APIs
    • In this module, we will cover the comprehensive Java 8 Date/Time API. You will practice working with various date and time classes, formatting/parsing, timezone conversions, and calculating differences, modernizing your time-based programming skills.
  • Base Project Setup for Exploring Java 9 and Beyond Features
    • In this module, we will guide you through establishing a foundational project setup. This will enable you to experiment seamlessly with Java 9 and later features in a well-organized environment.
  • Local Variable Type Inference (LVTI) Using var
    • In this module, we will introduce the ‘var’ keyword for local variable type inference. You will learn how to leverage it for concise declarations while understanding best practices and limitations to write clear, maintainable code.
  • Text Blocks
    • In this module, we will explore Text Blocks, a feature that streamlines multiline string management in Java. You will practice creating and formatting text blocks for cleaner and more readable string code.
  • Enhanced Switch
    • In this module, we will uncover the power of enhanced switch expressions. You will learn to write concise, readable switch statements with expression forms, yield usage, and exhaustiveness checks for safer code.
  • Records
    • In this module, we will introduce record classes as a succinct way to model immutable data. You will enhance records with custom logic and explore how Java automatically generates common methods for convenience.
  • Sealed Classes/Interfaces
    • In this module, we will explore sealed classes and interfaces, allowing fine-grained control over class hierarchies. You will practice defining and managing inheritance boundaries for more secure and maintainable designs.
  • Pattern Matching
    • In this module, we will cover pattern matching techniques to simplify type checks and data deconstruction. You will practice with record and guarded patterns to write expressive and maintainable conditional code.
  • CheckoutService Application [Real-Time Use Case]
    • In this module, we will dive into a real-time CheckoutService application. You will explore its architecture and build key features using sealed classes, consolidating your understanding of advanced Java concepts in a practical context.
  • Simple Web Server
    • In this module, we will create a simple web server leveraging the new capabilities introduced in Java 18. You will get hands-on experience with lightweight HTTP handling and server setup for web-based applications.
  • New Http Client
    • In this module, we will explore the new HttpClient API for performing HTTP requests in Java. You will implement synchronous and asynchronous calls, perform testing, and handle real-world data retrieval scenarios.
  • Java Platform Module System (JPMS)
    • In this module, we will introduce the Java Platform Module System to help you create modular, maintainable applications. You will set up modular projects, handle complex dependencies, and migrate legacy codebases efficiently.

Taught by

Packt - Course Instructors

Reviews

Start your review of Modern Java - Mastering Features from Java 8 to Java 21

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.