CodeGym
Promotion
CodeGym University
Java FullStack
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
  • The concept of inheritance and the extends syntax

    JAVA 25 SELF
    Level 17, Lesson 0
    In this lecture, we’ll figure out what inheritance in Java is, how it helps you avoid code duplication, and how to declare hierarchies using the extends keyword. We’ll look at what exactly a subclass inherits, what limitations exist (single inheritance, private members, constructors), work through a practical example with animals, nuances with constructors, and common mistakes.
    Available
  • Method overriding (override), @Override annotation

    JAVA 25 SELF
    Level 17, Lesson 1
    In this lecture we break down method overriding in Java: how and why a subclass replaces its parent’s behavior, what benefits the @Override annotation gives, how polymorphism works when calling through a base-type reference, as well as the key rules (signature, access modifiers, exceptions, covariance) and restrictions ( static, final, private). We wrap up with hands-on practice on a mini‑project “Zoo” and a review of common mistakes.
    Available
  • Using super: calling the base class constructor and methods

    JAVA 25 SELF
    Level 17, Lesson 2
    We break down the super keyword in Java: how to call base-class methods and constructors, how to access shadowed fields of the parent, when and why to extend behaviour via super and super(...), as well as limitations (cannot be used in static methods, no access to private) and common pitfalls. Lots of practical examples on the Animal/ Cat/ Dog and Vehicle/ Car hierarchies.
    Available
  • Creating class hierarchies: real-world examples

    JAVA 25 SELF
    Level 17, Lesson 3
    We will learn to design and implement class hierarchies in Java: how to identify the general and the specific, build an inheritance tree, where the is-a relationship is appropriate, and when it is better to use composition ( has-a). We will look at real-world examples (animals, geometry, transportation, users), architectural nuances, and common design mistakes.
    Available
  • Problems and limitations of inheritance

    JAVA 25 SELF
    Level 17, Lesson 4
    In this lecture, we discuss the boundaries of the inheritance model in Java: single class inheritance, the absence of constructor inheritance, and the inaccessibility of private members. We will examine “fragile” hierarchies and the effect of “breaking” inheritance, present alternatives—composition ( has-a), delegation, and interfaces—as well as criteria for “when you really need extends.” Along the way, we will note calling the parent constructor via super(...) and common design mistakes.
    Available
  • Polymorphism: what it is and why you need it

    JAVA 25 SELF
    Level 18, Lesson 0
    In this lecture, we break down polymorphism in Java: what it is, how overloading differs from overriding, how late binding works, and why one interface can have many implementations. With practical examples we will see how polymorphism simplifies architecture, makes code extensible, and reduces coupling between modules.
    Available
  • Method overloading (overloading)

    JAVA 25 SELF
    Level 18, Lesson 1
    Diving into method overloading in Java: when it makes sense to declare multiple versions of the same method, how the compiler chooses the best match by parameters, why you cannot overload by return type only, and how overloaded constructors and ... varargs work. We’ll go through examples with println, build a small Calculator, and cover common mistakes related to automatic conversions and ambiguity between Integer/ Long.
    Available
  • Method overriding: how it differs from overloading

    JAVA 25 SELF
    Level 18, Lesson 2
    A deep dive into method overriding in Java: how overriding enables run-time polymorphism, how it differs from overloading, what rules apply (signatures, access, exceptions, covariance), how to use @Override and call parent logic via super. We will show practical examples and walk through common mistakes.
    Available
  • Using polymorphism in practice

    JAVA 25 SELF
    Level 18, Lesson 3
    We demonstrate polymorphism with real examples: how to store heterogeneous objects in one collection of a base type and call the “right” methods without if/ switch, how adding a new subclass doesn’t require rewriting the logic, and what limitations the approach has. We will build an employee hierarchy with a work() method, talk about extensibility, and break down common mistakes.
    Available
  • The relationship between polymorphism and abstract classes

    JAVA 25 SELF
    Level 18, Lesson 4
    How abstract classes and methods define a common contract and enable polymorphism in Java: why you cannot create an abstract object, how subclasses implement required methods, how to work via a base type and still get the “correct” behavior. We will look at examples with animals and an employee hierarchy, syntax nuances, and common mistakes.
    Available
  • Abstraction in OOP: why and how to use it

    JAVA 25 SELF
    Level 19, Lesson 0
    A clear introduction to abstraction in OOP with Java: what it is, why it matters, and how to apply it in design. We’ll cover language tools — abstract classes abstract class and interfaces interface, abstract methods, and working via a shared contract (for example, calls like payment.process() or draw()). With practical examples ( Shape, Payment, Transport) we’ll show how to hide implementation details, reduce coupling, and make system extension easier.
    Available
  • Abstract classes and methods: syntax, examples

    JAVA 25 SELF
    Level 19, Lesson 1
    In this lecture, we walk through abstract classes and methods in Java step by step: when to use abstract, how to declare an abstract class, how it differs from an interface, and how to implement required methods (for example, makeSound()) in subclasses. We’ll support the theory with clear examples ( Animal, Transport, Shape) and cover common mistakes: from trying to instantiate an abstract class to misusing modifiers.
    Available
  • 1
  • ...
  • 8
  • 9
  • 10
  • 11
  • 12
  • ...
  • 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