CodeGym
Promotion
CodeGym University
Learning
Courses
Tasks
Surveys & Quizzes
Games
Help
Schedule
Community
Users
Forum
Chat
Articles
Success stories
Activity
Reviews
Subscriptions
Light theme

Lessons

  • Reviews
  • About us
Start
Start learning
Start learning now
  • My Progress
  • Courses
  • University
  • Quest Map
  • Lessons
  • Sealed classes: syntax and usage

    JAVA 25 SELF
    Level 65, Lesson 0
    In this lecture we cover closed hierarchies in Java 17+: how to declare classes and interfaces with the sealed modifier, specify allowed subclasses via permits, choose the status of subclasses ( final, sealed, non-sealed), and why this strengthens exhaustiveness checking of switch with pattern matching without a default branch. We’ll look at examples with domain models, interaction with interface and record, as well as typical mistakes.
    Available
  • Pattern Matching for instanceof

    JAVA 25 SELF
    Level 65, Lesson 1
    Let’s break down how, starting with Java 16+, type checking became simpler thanks to pattern matching for instanceof: you check the type and immediately declare a variable of the required type ( if (obj instanceof String s) {...}). We’ll compare it with the “old” approach using explicit casting ( ( String )), discuss variable scope, working with null, inheritance, limitations, and common mistakes. Less boilerplate — better readability and safety (without ClassCastException).
    Available
  • Pattern Matching in switch (Java 17/21+)

    JAVA 25 SELF
    Level 65, Lesson 2
    In this lecture, we break down the modern switch with pattern matching: case branches with automatic type narrowing, handling null via case null, guard conditions when, exhaustive checks with sealed hierarchies, and nested patterns for record. We show practical examples, nuances, JDK 21+ requirements, and common mistakes.
    Available
  • Record Patterns (Java 21+): syntax, examples

    JAVA 25 SELF
    Level 65, Lesson 3
    We break down pattern matching for record classes in Java 21+: how to destructure components right in instanceof and switch, use nested patterns and when guard expressions, and build expressive and safe code on top of record classes and sealed hierarchies. Practical examples, limitations, a comparison table, and common mistakes.
    Available
  • Common pitfalls of the new features

    JAVA 25 SELF
    Level 65, Lesson 4
    A quick guide to the pitfalls of modern language features: the scope of pattern variables in instanceof, behavior with null (including switch branches), nuances of sealed/ permits hierarchies and the requirement for default, limitations of record-patterns, as well as compatibility with JDK and IDE versions. To wrap up — a motivational congratulations on completing the Java 25 course.
    Available
  • Final Project

    JAVA 25 SELF
    Level 66, Lesson 0
    The final project of the course: apply all the knowledge gained about SQL and PostgreSQL to solve a comprehensive task. In this project you'll solidify skills working with tables, queries, indexes, transactions, and optimization.
    Available
  • Final Project

    JAVA 25 SELF
    Level 66, Lesson 1
    This section presents the course final project: the capstone assignment where you can apply all the knowledge you've gained about SQL and PostgreSQL in practice. Test your skills with queries, aggregates, subqueries, indexes, and optimization!
    Available
  • Final Project

    JAVA 25 SELF
    Level 66, Lesson 2
    The final stage of the course: the final project on SQL and PostgreSQL. Here you can apply all the knowledge you've gained in practice, implement your own database, write complex queries, and demonstrate skills in optimization and data analysis.
    Available
  • Final Project

    JAVA 25 SELF
    Level 66, Lesson 3
    Capstone project of the course: here you can apply all the knowledge you've gained about SQL and PostgreSQL in practice by solving a comprehensive task that mirrors real-world database work.
    Available
  • Final Project

    JAVA 25 SELF
    Level 66, Lesson 4
    This section presents the course final project: the capstone assignment where you can apply all the knowledge you've gained about SQL and PostgreSQL in practice. Test your skills with queries, aggregates, subqueries, indexes, and optimization!
    Available
  • 1
  • ...
  • 28
  • 29
  • 30
Learn
  • Registration
  • Java Course
  • Help with Tasks
  • Pricing
  • Java Syntax
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success Stories
  • Activity
  • Affiliate Program
Company
  • About us
  • Contacts
  • Reviews
  • Press Room
  • CodeGym for EDU
  • FAQ
  • Support
CodeGym CodeGym is an online course for learning Java programming from scratch. This course is a perfect way to master Java for beginners. It contains 1200+ tasks with instant verification and an essential scope of Java fundamentals theory. To help you succeed in education, we’ve implemented a set of motivational features: quizzes, coding projects, content about efficient learning, and a Java developer’s career.
Follow us
Interface language
English
Deutsch Español हिन्दी Français Português Polski বাংলা 简体中文 मराठी தமிழ் Italiano Bahasa Indonesia 繁體中文 Nederlands 日本語 한국어 Bulgarian Danish Hungarian Basa Jawa Malay Norwegian Romanian Swedish Telugu Thai Українська Filipino Turkish Azərbaycan Русский Vietnamese
Programmers Are Made, Not Born © 2026 CodeGym
MastercardVisa
Programmers Are Made, Not Born © 2026 CodeGym