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 objects via reflection

    JAVA 25 SELF
    Level 62, Lesson 3
    How to create objects and manage classes on the fly: why Class.newInstance() is deprecated, how to correctly use getConstructor/ getDeclaredConstructor and Constructor.newInstance, invoke methods via Method.invoke, and read/modify fields via Field. We’ll cover typical exceptions ( ReflectiveOperationException and others), module system limitations, useful practices, and a small utility for dynamic instantiation. Plus — a visual diagram of the whole process.
    Available
  • Reflection and Dependency Injection

    JAVA 25 SELF
    Level 62, Lesson 4
    In this lecture we examine practical reflection in Java: how to use Class, Field and Method to read private fields ( setAccessible( true)) and build a simple serializer; how DI containers inject dependencies by annotations ( @Inject, @Autowired) through constructors and fields; how dynamic proxies based on Proxy and InvocationHandler intercept calls; where this is used in practice ( Spring, JUnit, Jackson) and what limitations and errors you may encounter.
    Available
  • Logging fundamentals: java.util.logging, Log4j, SLF4J

    JAVA 25 SELF
    Level 63, Lesson 0
    Why applications need logs, and why simply using System.out.println doesn’t save you in production. We’ll break down the levels ERROR/ WARN/ INFO/ DEBUG/ TRACE, the built-in stack java.util.logging and the settings file logging.properties, get acquainted with Log4j 2, Logback and the facade SLF4J. We’ll compare with console output, add dependencies, and dissect common configuration and usage mistakes.
    Available
  • Formatting and log levels: best practices

    JAVA 25 SELF
    Level 63, Lesson 1
    We break down what makes a good log message (timestamp, level INFO/ ERROR, logger name, text, stack), how to format entries correctly using SLF4J/Log4j2 templates ( "{}" instead of concatenation), how to log exceptions ( logger.error(..., ex)), when to use levels ERROR/ WARN/ INFO/ DEBUG/ TRACE, as well as best practices: no sensitive data, clear messages, correlation IDs ( orderId, userId) and a solid log4j2.xml configuration.
    Available
  • Logging in multithreaded and web applications

    JAVA 25 SELF
    Level 63, Lesson 2
    How to make logs reliable in multithreading and on the web: thread safety of mature libraries ( Logback, Log4j 2, java.util.logging), MDC context with requestId propagation, integration with Spring filters and error handlers, how it differs from System.out, nuances of thread pools, and tracing in microservices (traceId, OpenTelemetry). We break down practical examples and common mistakes, using SLF4J and Logger as a static final field.
    Available
  • JVM Monitoring: JMX, VisualVM, Java Flight Recorder

    JAVA 25 SELF
    Level 63, Lesson 3
    This lecture is a practical guide to monitoring the JVM: how to read standard metrics via JMX and JConsole, how to visually observe memory, threads, and profile methods in VisualVM (including heap dump and thread dump), and how to record a “black box” with Java Flight Recorder and analyze it in JDK Mission Control. We’ll show launch commands ( -XX:StartFlightRecording), walk through typical analysis scenarios for GC/threads, and common mistakes.
    Available
  • Profiling and code optimization: tools, approaches

    JAVA 25 SELF
    Level 63, Lesson 4
    We explain how profiling differs from monitoring, which metrics matter (method execution time, memory, threads, locks), and which tools to use: VisualVM, Java Flight Recorder, as well as commercial profilers. In practice, we examine a “slow” calculator, learn to find hot spots, analyze a heap dump, and remove bottlenecks by replacing algorithms, reducing allocations, and caching. We wrap up with a visual diagram of the optimization process and an overview of common pitfalls.
    Available
  • Memory layout in the JVM: stack, heap, PermGen/Metaspace

    JAVA 25 SELF
    Level 64, Lesson 0
    Where local variables, objects, and class metadata go during JVM execution: we break down thread stacks, the heap, and the evolution from PermGen → Metaspace. We’ll talk about how GC works, what memory errors occur ( StackOverflowError, OutOfMemoryError), and how startup flags affect things ( -Xss, -Xmx, -XX:MaxMetaspaceSize). Diagrams, a Mermaid chart, and a working example are included.
    Available
  • Garbage collectors: G1, ZGC, Shenandoah, comparison

    JAVA 25 SELF
    Level 64, Lesson 1
    In this lecture, we explore how the garbage collector ( GC) in the JVM works, how classic Serial/ Parallel/ CMS differ from modern G1, ZGC, and Shenandoah, what young and old generations are, why Stop-the-World pauses happen, and how to minimise them. In practice, we’ll see how to enable different GCs with flags ( -XX:+UseG1GC, -XX:+UseZGC, -XX:+UseShenandoahGC), tune pauses ( -XX:MaxGCPauseMillis) and heap sizes ( -Xms/ -Xmx), read logs ( -Xlog:gc*), and avoid common mistakes (for example, forcing a call to System.gc()).
    Available
  • Local variables, memory leaks, weak references

    JAVA 25 SELF
    Level 64, Lesson 2
    From this lecture you’ll learn where local variables live (the thread stack) and how it differs from the heap, why memory leaks are still possible in Java despite the GC, and how to avoid them. We’ll break down real scenarios: “eternal” static-collections, unremoved listeners, and caches. We’ll get to know the reference family: SoftReference, WeakReference, PhantomReference, as well as the WeakHashMap container. We’ll practice fixing leaks and discuss why calling System.gc() is merely a hint to the JVM, not a command, and how it can end with an OutOfMemoryError.
    Available
  • Memory analysis tools: jmap, jvisualvm

    JAVA 25 SELF
    Level 64, Lesson 3
    A practical guide to diagnosing memory issues in the JVM: take a heap dump with jmap, read summaries via -heap and -histo, explore the application in jvisualvm (tabs Monitor, Heap Dump, Threads, Profiler), dissect a leak example, and get acquainted with Eclipse MAT and jconsole. In the end — common mistakes and tips.
    Available
  • Dissecting common memory management mistakes

    JAVA 25 SELF
    Level 64, Lesson 4
    A practical breakdown of why a Java application can leak memory and slow down: forgotten listeners ( addActionListener/ removeActionListener), everlasting static collections, unclosed resources (tip: try-with-resources), anonymous/inner classes retaining references, and abuse of System.gc(). We will learn to read GC logs ( -Xlog:gc*, -XX:+PrintGCDetails), choose a collector, build caches on WeakHashMap, monitor ( jvisualvm, jconsole), analyze a heap dump, and properly tune -Xmx/ -Xms. We’ll finish with real-world leak examples and their fixes.
    Available
  • 1
  • ...
  • 27
  • 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