Skip to content

Glossary: Java Basics

Field

Also written: fields

A variable that belongs to an object, such as a product's `name`, `priceCents` and `stock`; every object gets its own copy. In a `void main()` file, a variable outside all methods is also a field.

Where the book teaches it

Related terms

ClassObjectprivate