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
  • Implementing Abstractions and Hierarchies

    JAVA 25 SELF
    Level 19, Lesson 2
    A practical guide to building class hierarchies in Java: from abstraction to details. Using examples of shapes, a mini editor, payments, and transport, we show how to move common parts into a base abstract class, override methods like area()/ draw(), extend the system without rewriting code, and avoid duplication. We’ll finish with a review of typical mistakes and design tips.
    Available
  • Examples of building abstractions in real-world problems

    JAVA 25 SELF
    Level 19, Lesson 3
    We practice applying abstractions in real-world scenarios: payments, transport, a graphics editor. We’ll show how to extract shared behavior into a base abstract class, work through a common contract, and replace branchy if- else code with polymorphism. Along the way, we’ll see how to invoke methods like process(), move(), draw()/ resize() uniformly so the code is flexible and extensible.
    Available
  • Simplifying complex systems with abstractions

    JAVA 25 SELF
    Level 19, Lesson 4
    How to break complex applications into levels of abstraction (UI, business logic, data access) so the code remains clear and extensible. In practice, we build a mini task manager with layers Task, TaskRepository, TaskService, show how to swap implementations, and highlight team benefits. We’ll go over best practices, common mistakes, and an example with services OrderService/ OrderRepository, as well as methods like saveOrder() and findUserById().
    Available
  • The concept of an interface, declaration syntax

    JAVA 25 SELF
    Level 20, Lesson 0
    In this lecture you will learn what an interface is in Java, how to declare it using the interface keyword, how classes implement the contract via implements, and why methods are considered public abstract by default. We will examine how an interface differs from a class, examples from the JDK ( Comparable, Runnable, Serializable), a visual diagram, and common mistakes.
    Available
  • The difference between interfaces and abstract classes

    JAVA 25 SELF
    Level 20, Lesson 1
    In this lecture, we’ll compare interfaces and abstract classes in Java: when to choose which, how they differ in capabilities and limitations, what their signatures look like ( abstract class and interface), what modifiers like public, abstract, static mean, and we’ll also look at examples from the JDK, practical cases, and common mistakes (inheritance, implementation, using implements/ extends).
    Available
  • Implementing multiple interfaces

    JAVA 25 SELF
    Level 20, Lesson 2
    In this lecture, we look at how a single class in Java can implement several interfaces at once: the syntax with the implements keyword, combining roles (for example, Movable, Attackable, Serializable), matching method signatures, the absence of the diamond problem, and what to do when default methods conflict. Practical examples and a breakdown of typical mistakes are provided.
    Available
  • Functional interfaces: @FunctionalInterface

    JAVA 25 SELF
    Level 20, Lesson 3
    In this lecture, we examine what a functional interface is (exactly one abstract method), how and why to mark it with the @FunctionalInterface annotation, what is allowed to be added to an interface via default and static methods, and how to use such interfaces in practice (regular classes and anonymous classes). Examples with Runnable, Comparator<T>, and interfaces from java.util.function are complemented by a table and an analysis of common mistakes.
    Available
  • Interfaces in Java Architecture, Design Patterns

    JAVA 25 SELF
    Level 20, Lesson 4
    How interfaces turn code into a flexible architecture: we program to abstractions, inject dependencies via DI, swap implementations in tests, and add new behaviors without changing the core ( OCP). We break down how interfaces underpin the Observer, Strategy, and Command patterns, and show hands-on examples ( UserRepository, NotificationSender, payment strategies).
    Available
  • Introduction to lambda expressions

    JAVA 25 SELF
    Level 21, Lesson 0
    In this lecture, we’ll break down lambda expressions in Java: what they are and why they’re needed, how the syntax and shorthand work, how lambdas relate to functional interfaces ( @FunctionalInterface), how they differ from anonymous classes, and how variable capture works ( final / effectively final). With practical examples using Runnable, Consumer, Comparator, Function, and the Stream API, we’ll see how to write shorter and clearer code. We’ll finish with a “Common mistakes” section and tips on how to avoid them.
    Available
  • Method References (::): references to methods

    JAVA 25 SELF
    Level 21, Lesson 1
    A quick guide to method references in Java: where and how to use a method reference instead of lambdas. We will cover 4 forms: Class::method (static and “on an instance”), object::method, Class::new. We’ll understand signature matching with functional interfaces, compare with lambda expressions, look at practical examples with forEach, sort, map, and discuss common pitfalls (signature mismatches, method overloading, etc.).
    Available
  • Default methods in interfaces

    JAVA 25 SELF
    Level 21, Lesson 2
    In this lecture we look at why Java 8 introduced default methods in interfaces, how they allow evolving an API without breaking old code, their syntax (the default keyword before the return type) and behaviour in implementations. Using examples from the standard library ( List: forEach, replaceAll, sort) we’ll review practical usage. We’ll discuss limitations: you cannot override Object methods ( equals/ hashCode/ toString), as well as the rules for resolving conflicts with multiple interface implementation and common mistakes.
    Available
  • Static methods in interfaces

    JAVA 25 SELF
    Level 21, Lesson 3
    We will examine how and why interfaces in Java received static methods: declaration syntax, differences from default methods, key constraints (not inherited, not overridden, callable only via the interface name, access only to static members, support for private static since Java 9+). In practice, we will look at Movable.resetPosition(), a helper Logger, collection factories List.of()/ Set.of()/ Map.of(), and the utility Comparator.reverseOrder(). Finally — common mistakes and how to avoid them.
    Available
  • 1
  • ...
  • 9
  • 10
  • 11
  • 12
  • 13
  • ...
  • 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