# Static Method

> A method that belongs to the class, not to any one object.

**Field:** Software Development  
**Category:** Programming Paradigms  
**Also known as:** Class Method, Static Function, staticmethod

## Think of it like

It is like a school bell. It belongs to the whole school, not to one child.

## Definition

A static method belongs to the class itself, not to one object made from it. You call it on the class name, like Math.max(3, 7). It cannot see any one object's properties, because there is no object. Static methods suit helpers and counters that make sense for the whole class. Java, C# and JavaScript mark them with the word static.

## Example

A Temp class has a static method that turns 20 degrees C into F. Code calls Temp.toF(20) and never makes an object.

## Example code

```javascript
class Temp {
  static toF(c) { return c * 9 / 5 + 32; }
}
console.log(Temp.toF(20));
// 68
```

The method is called on the class name. No object is needed.

## Why it matters

It puts helpers next to the class they belong to. You can use them without making an object first.

## Common mistake

Making every method static so you never make objects. Then you lose the point of objects: data kept with the code that uses it.

## Three principles

- **Class, not object.** Called on the class name.
- **No object data.** It cannot read one object's values.
- **Good for helpers.** Shared tools and counters.

## Related terms

- [Method (Programming)](https://learn.benibix.com/term/development/method)
- [Class](https://learn.benibix.com/term/development/class)
- [Object (Programming)](https://learn.benibix.com/term/development/object)
- [this and self](https://learn.benibix.com/term/development/this-and-self)
- [Function](https://learn.benibix.com/term/development/function)

![A card for a class named Dog. Its top part lists two properties, a public name and a private age. Its lower part lists a method, bark, that uses self.name, and a static method, count, marked as belonging to the class. Two dog objects, Rex and Bella, sit beside it, each with its own name. An arrow from self points at Rex.](https://learn.benibix.com/diagrams/dev7-class-parts.svg)

---

Source: https://learn.benibix.com/term/development/static-method
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.
