0Pricing
Java Academy · Lesson

Fields, Methods, Constructors

Learn how to add fields for data, methods for behavior, and constructors for easy object setup.

Fields

Fields: variables inside a class that hold data. Each object has its own copy of the fields.

Methods

Methods: functions inside a class that describe behavior. They can use and update fields.

All lessons in this course

  1. Classes & Objects
  2. Fields, Methods, Constructors
  3. Encapsulation (getters/setters)
← Back to Java Academy