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
  • Creating custom exceptions

    JAVA 25 SELF
    Level 24, Lesson 1
    In this lecture, we’ll cover when and why to create your own exceptions in Java: how to choose between Exception and RuntimeException, design constructors with the String message and Throwable cause parameters, add useful fields, and use them correctly in code. We’ll discuss naming, scope of responsibility, documenting via throws, and common mistakes. Plus—why it’s sometimes better to throw an exception than return false.
    Available
  • Exception chaining (Exception Chaining)

    JAVA 25 SELF
    Level 24, Lesson 2
    A step-by-step guide to exception chaining in Java: how to correctly “wrap” exceptions and pass the cause so you don’t lose the call stack. We’ll examine constructors with a Throwable parameter, the use of getCause() and printStackTrace(), show an example with UserManagementException, and discuss common mistakes—from throwing a new exception without a cause to “swallowing” errors.
    Available
  • Advanced exception handling and best practices

    JAVA 25 SELF
    Level 24, Lesson 3
    Advanced exception handling in Java: multiple catch blocks, the multi-catch syntax and its rules, ordering from specific to general, as well as best practices — from the inadmissibility of “swallowing” errors to throwing the most specific exceptions and avoiding exceptions as a control-flow mechanism. Everything is accompanied by examples, a breakdown of common mistakes, and style tips.
    Available
  • Exceptions as part of the API and try-with-resources

    JAVA 25 SELF
    Level 24, Lesson 4
    In this lecture we’ll break down why exceptions are part of a method’s contract in Java, how to document them via Javadoc with the @throws tag, when to choose checked vs. unchecked exceptions, and how to work with resources safely using the try-with-resources construct. We’ll discuss the role of the AutoCloseable interface, show practical examples, and cover common pitfalls.
    Available
  • Introduction to Git: why version control matters

    JAVA 25 SELF
    Level 25, Lesson 0
    In this lecture, you will learn what Git is and why modern developers need it, create your first repository on GitHub, and learn how to set up your IDE environment for effective version control workflows.
    Available
  • Developer’s daily workflow: commit, push, and .gitignore

    JAVA 25 SELF
    Level 25, Lesson 1
    In this lecture, you’ll master the basic workflow: learn to save changes (commit), push them to GitHub, and configure ignoring unnecessary files with .gitignore.
    Available
  • Safe experiments: working with branches

    JAVA 25 SELF
    Level 25, Lesson 2
    In this lecture, you will learn how to create separate branches for new tasks, switch between them, merge changes, and—most importantly—confidently resolve merge conflicts using powerful IDE tools.
    Available
  • The magic of pull requests

    JAVA 25 SELF
    Level 25, Lesson 3
    In this lecture, you will learn what a pull request (PR) is, why it is the key tool for team development, and how to create and review PRs right from your IDE.
    Available
  • Professional tools and troubleshooting

    JAVA 25 SELF
    Level 25, Lesson 4
    In this lecture, you will learn how to undo changes, remove bad commits, temporarily stash your work, and use the project history to search for information — all with your IDE’s tools.
    Available
  • Java collections overview — why collections are needed

    JAVA 25 SELF
    Level 26, Lesson 0
    This lecture is a quick, hands-on overview of Java collections. We’ll discuss why fixed-size arrays are not enough, how collections help, and how to choose between List, Set and Map. We’ll show practical examples with ArrayList and HashMap, compare arrays with collections (operations add(), remove(), contains(), sorting via Collections.sort()), and finish by covering common pitfalls: raw types, imports, confusion between length and size(), order expectations, and primitives in collections.
    Available
  • List: ArrayList and LinkedList, basic operations

    JAVA 25 SELF
    Level 26, Lesson 1
    This lecture is a hands-on introduction to the List interface and its popular implementations: ArrayList and LinkedList. We will cover how to create lists, call basic methods ( add, get, set, remove, size, clear), iterate over elements, and search them. We will compare operation performance and discuss when to choose one implementation over the other. Finally, we will look at typical mistakes and how to avoid them ( IndexOutOfBoundsException, ConcurrentModificationException, a correct equals implementation, and working with generics).
    Available
  • Map: HashMap and TreeMap, keys and values

    JAVA 25 SELF
    Level 26, Lesson 2
    In this lecture, we examine maps in Java: the Map interface, key operations ( put, get, remove, containsKey), the differences between HashMap (fast access) and TreeMap (key sorting), iterating via keySet(), values(), and entrySet(), as well as typical pitfalls: expecting order in HashMap, using null keys in TreeMap, and issues with ConcurrentModificationException. Plenty of code examples and practical scenarios will help you confidently use Map in your projects.
    Available
  • 1
  • ...
  • 11
  • 12
  • 13
  • 14
  • 15
  • ...
  • 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