# class

Declare reference-shaped object data

Last updated: 2026-09-09

Package: language | Status: generated-cpp-only

Tags: complete-program, cpu, data, keyword, yeho

Prefer thing and ordinary functions for Kyber-ready programs. Use class and interface only while evaluating the explicit oracle route.

```yh
class
```


## Self contained reference link

Prefer thing and ordinary functions for Kyber-ready programs. Use class and interface only while evaluating the explicit oracle route.

Verification: type checked

```yh
external class referenceCounter
{
    int value

    referenceCounter(int value)
    {
        this.value = value
    }

    Bump() returns int
    {
        this.value = this.value + 1
        return this.value
    }
}

referenceCounter counter = referenceCounter(41)
Console.Log(Text.Format("self-contained-reference={0}", counter.Bump()))

```

Save this beside start.yh as project.mech:

```toml
package = "tests.compiler.selfContainedReferenceLink"
version = "0.1.0"
selfContainedApp = true

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/word--class/complete --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Class and interface dispatch is generated-C++ only in Yeho Core 2026.1.

Generic classes and interfaces are not admitted even though the parser reserves research syntax.

Source: yeho/docs/language/conformance-2026.1.json: class-and-interface-dispatch; parser_declarations.cpp

AI training permission: https://demonhunterlabs.com/ai-use
