# Defining an Object

An object's responsibilities split into what it knows (its variables) and what it can do (its methods), and a class is the blueprint that describes both.

Apprentice · Java · OOP · Updated November 16, 2026

By Gregor Dzierzon

Once we have an understanding of what the responsibilities of an object are, we can separate the responsibilities into 2 general categories.

The things the object **knows** and the things it can **do**.

![A refrigerator: it knows its temperature and how full it is, and it can open its door and take items in or out](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/09/c5902147680b4685a6fd3b38209bdb2c.png)

## Things an object KNOWS

The things an object **knows** are the state of the object. In other words, the things that the object needs to remember.

Some things a refrigerator may need to "remember" are:

- Current temperature
- Refrigerator capacity
- Used space

This data is stored in the object as variables.

## Things an object can DO

The things that an object can **do** are the methods of an object. Methods are simply functions that belong to an object.

Some things that a refrigerator might be able to do (or that can be done to it) are:

- Open door
- Add item
- Remove item

## What is a Class: a blueprint

A Class is a blueprint or a template from which an object is created. In UML (Unified Modeling Language), a class is drawn with three sections.

![A UML class box for Refrigerator in three parts: the class name; the variables it knows (temperature, capacity, usedSpace); and the methods it can do (increaseTemperature, decreaseTemperature, openDoor, closeDoor, addItem, removeItem)](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/58aafe870f824ecbaffee5830c58f9dc.webp)

## Cheat sheets

- [Defining an Object](https://www.ask-codey.com/cheat-sheets/working-with-objects-defining-an-object-cheat-sheet)

Source: https://www.ask-codey.com/lessons/working-with-objects-defining-an-object
