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
  • Interfaces from the standard library: Comparable, Serializable, etc.

    JAVA 25 SELF
    Level 21, Lesson 4
    We break down the key interfaces of the Java standard library and why they matter in real projects: natural ordering via Comparable<T> and custom rules with Comparator<T>, object serialization with Serializable, safe resource management through AutoCloseable, collection traversal thanks to Iterable<T>, as well as marker Cloneable and event listeners. With hands-on examples we will see the correct method signatures ( compareTo, compare, close, iterator) and common mistakes to avoid.
    Available
  • Record: syntax and benefits

    JAVA 25 SELF
    Level 22, Lesson 0
    We break down record classes in Java 16+: how to declare them, what the compiler generates “under the hood,” why they are more convenient than ordinary DTOs and value objects, and when to use them. Less boilerplate, more safety: immutability, correct equals/hashCode/toString, and convenient use in collections.
    Available
  • Immutability — immutability of record classes

    JAVA 25 SELF
    Level 22, Lesson 1
    Diving into the immutability of Java record classes: why their state cannot be changed after creation, what advantages this gives in multithreading and when working with collections, how records differ from regular classes, and how to properly protect against “mutability leaks” through arrays and collections. We will compare behaviour with mutable classes, go through practical examples, and typical mistakes.
    Available
  • equals, hashCode, toString: auto-generation

    JAVA 25 SELF
    Level 22, Lesson 2
    We will figure out why objects need the equals, hashCode, and toString methods, why their manual implementation in ordinary classes leads to boilerplate and error-prone code, and how record classes generate correct versions automatically. We will look at the impact on collections and debugging, when and how it is appropriate to override the default behavior, and which mistakes occur most often.
    Available
  • Record with methods

    JAVA 25 SELF
    Level 22, Lesson 3
    We learn how to enrich record classes with methods, use compact constructors for validation and data normalization, go over record limitations, interface implementation, and practical techniques. At the end—there’s a table of “what’s allowed/not allowed” and a review of common mistakes.
    Available
  • Differences between record and class, record limitations

    JAVA 25 SELF
    Level 22, Lesson 4
    Key differences between regular classes and record classes in Java: immutability, inheritance, auto-generated equals/hashCode/toString, constructors, and scope of use. We’ll break down record limitations, where they deliver the most value (DTO, Value Object, collection keys), when a regular class is preferable, and the most common mistakes developers make.
    Available
  • Common mistakes in class and object declarations

    JAVA 25 SELF
    Level 23, Lesson 0
    Common early-stage mistakes in Java: class access modifiers, matching the file name to the public class name, braces and placement of class members, object initialization, constructors, and excessive instance creation. We’ll look at best practices and build a mini‑example “Library”, and at the end we’ll break down typical error messages.
    Available
  • Pitfalls with inheritance and method overloading

    JAVA 25 SELF
    Level 23, Lesson 1
    We break down common Java mistakes with inheritance and method overloading: calling the base class constructor via super(...), restrictions of final classes and final methods, violating the Liskov substitution principle, overloading traps (auto type conversion, ambiguous calls, attempts to differ only by return type), as well as best practices and working examples with polymorphism.
    Available
  • Access modifier errors

    JAVA 25 SELF
    Level 23, Lesson 2
    Step by step, we go through access levels in Java and common mistakes: forgotten modifiers, breaking encapsulation, protected specifics outside the package, proper use of getters/setters, and returning copies of collections. We cement best practices with practical examples.
    Available
  • Problems of polymorphism and abstractions

    JAVA 25 SELF
    Level 23, Lesson 3
    We analyse polymorphism and abstractions in Java in practice: how a single interface triggers different behaviour, common mistakes (downcasting without checks, calling methods that are absent in the base type, “empty” abstractions, deep hierarchies), as well as best practices for using abstract classes, interfaces, and the @Override annotation in the training example “Library”.
    Available
  • Code style and readability, code conventions

    JAVA 25 SELF
    Level 23, Lesson 4
    Why Java developers need a unified code style and how to stick to it: we’ll go through common formatting mistakes, basic conventions (indentation, naming, order of class members), show refactoring examples and tools for auto‑formatting and static analysis, so that the code is readable and maintainable.
    Available
  • Exception hierarchy in Java

    JAVA 25 SELF
    Level 24, Lesson 0
    In this lecture we break down the fundamentals of Java’s exception system: the root class Throwable, the differences between Exception and Error, as well as the division into checked and unchecked exceptions. You will see a diagram and a table of differences, code examples with try- catch and throws, learn what to catch and what not to, and examine typical mistakes in exception handling.
    Available
  • 1
  • ...
  • 10
  • 11
  • 12
  • 13
  • 14
  • ...
  • 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