Skip to main content
Module 2 · Lesson 3 of 36/22 in the course~14 min
Module lessons (3/3)

Members static, final and Enum

Lesson preview5 hands-on exercises readyCourse Java · Module 2 — Fundamentals of OOP

Difference between class state (static) and instance, constants static final, and enum typed with fields and methods.

What you'll learn in this lesson

  • Distinguish static members (belonging to the class) from instance fields/methods.
  • Use final correctly on primitive variables, object references, and static final constants.
  • Model closed sets of values using enum equipped with fields, private constructors, and behavioral methods.

Overview

Not everything belongs to a single instance on the Heap: global counters, utility methods (Math.max), and shared constants belong to the integer class.

A member static lives only once per class and is accessible without creating objects (ClassName.method()):

Sections covered in this lesson

  1. 11. Fields and Methods static vs Instance
  2. 22. The final Modifier: Fixed Reference vs. Immutability
  3. 33. Simple and Compact Enums
  4. 44. Rich Enums with final Fields, Constructors and Methods
  5. 5Try it yourself
Pro Lesson · Module 2 — Fundamentals of OOP

Unlock "Members static, final and Enum" and the full Course Java curriculum

Difference between class state (`static`) and instance, constants `static final`, and `enum` typed with fields and methods.

Unlock all 5 hands-on exercises in this lesson plus every advanced WebAssembly module with automated checks.

  • Instant access to all advanced modules in Course Java plus 17 more courses
  • Hands-on browser exercises with automated test suites and solutions
  • 14-day money-back guarantee processed via Paddle.com

14-day guarantee · Cancel anytimeModule 1, all 18 interactive games, and cheatsheets are always free.