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
- Classes & Objects
- Fields, Methods, Constructors
- Encapsulation (getters/setters)