---
layout: ../../../layouts/DocsLayout.astro
title: Static
---
import Code from "../../../components/Code.astro"

# Static in classes


## Class constants

<Code thpcode={`
class Cat
{
    // Stateful code
}

static Cat
{
    const CONSTANT = "constant value"
}

print(Cat::CONSTANT)
`} />


## Static methods

aka. plain, old functions


<Code thpcode={`
static Cat
{
    fun static_method() -> Int
    {
        // ...
    }
}

Cat::static_method()
`} />


## Static properties

aka. global variables


<Code thpcode={`
static Cat
{
    pub var access_count = 0
}

print(Cat::access_count)    // 0
Cat::access_count += 1
print(Cat::access_count)    // 1
`} />




