# Method

say it: **“METH-ud”** **/ˈmɛθəd/**

A function that belongs to a class and describes something its objects can do.

## What is **Method**?

A **method** is a function that belongs to an object or class. It is something the object can *do*, often using its own data. `cart.AddItem(book)` calls the `AddItem` method on the cart.

```csharp
public class ShoppingCart
{
    private readonly List<string> items = new();

    public void AddItem(string item) => items.Add(item);
}
```

Level: Novice · [More OOP terms at this level](https://www.ask-codey.com/glossary?category=oop&level=1)

Updated: November 17, 2026

## In other subjects

- [Method in C#](https://www.ask-codey.com/glossary/method-c-sharp)
- [Method in Java](https://www.ask-codey.com/glossary/method-java)
- [Method in JavaScript](https://www.ask-codey.com/glossary/method-javascript)
- [Method in Python](https://www.ask-codey.com/glossary/method)

Source: https://www.ask-codey.com/glossary/method-oop
