# Class

> A plan for making objects. It lists their data and their actions.

**Field:** Software Development  
**Category:** Programming Paradigms  
**Also known as:** Class (Programming), Class Definition

## Think of it like

Think of it like a cookie cutter. You make one cutter, then press out lots of cookies.

## Definition

A class is a plan for making objects of one kind, like dogs or players. It says what data each object will hold and what actions it can do. The class itself is just the plan; each object made from it is real and has its own values. In most languages a class name starts with a capital letter. You use the class name to make a new object.

## Example

Emma writes a Dog class with a name and a speak method. She makes a dog called Rex from it, and Rex says woof.

## Example code

```python
class Dog:
    def __init__(self, name):
        self.name = name

    def speak(self):
        return self.name + " says woof"

rex = Dog("Rex")
print(rex.speak())  # Rex says woof
```

One plan called Dog, and one dog made from it.

## Why it matters

Classes let you write the shape of a thing once and reuse it everywhere.

## Common mistake

Mixing up the class and the object. Dog is the plan; Rex is one dog.

## Three principles

- **A plan.** Not a real thing yet.
- **Data and actions.** What each object holds and does.
- **Many from one.** Make as many as you need.

## Related terms

- [Object (Programming)](https://learn.benibix.com/term/development/object)
- [Method (Programming)](https://learn.benibix.com/term/development/method)
- [Constructor](https://learn.benibix.com/term/development/constructor)
- [Object-Oriented Programming (OOP)](https://learn.benibix.com/term/development/object-oriented-programming)
- [Property (Programming)](https://learn.benibix.com/term/development/property)
- [Static Method](https://learn.benibix.com/term/development/static-method)
- [Struct](https://learn.benibix.com/term/development/struct)

## Told apart from

- [Class vs Object](https://learn.benibix.com/compare/class-vs-object): A class and an object are not the same thing. The class is the plan, like a cookie cutter. An object is one real thing made from it, with its own values.
- [Struct vs Class](https://learn.benibix.com/compare/struct-vs-class): A struct is a simple bundle of named values. In C#, Swift and Go it is copied when you pass it. A class object is shared, so a change shows everywhere.

---

Source: https://learn.benibix.com/term/development/class
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
