# Static Variables

Budgie syntax for static variables behaves almost identically to the member equivalents. Accessing them takes in the class name instead of an instance reference.

Additionally, static members may declare an initial value as a final parameter.

```
class start : AnglePrinter
    static variable declare : private rightAlias string "right"
    static variable declare : private rightAmount int 90

    member function declare start : public PrintAngle string angle int
        if start : { operation : angle (equal to) { static variable : private AnglePrinter rightAmount } }
            return : { static variable : private AnglePrinter rightAlias }
        if end

        return : { string format : ("{0} degrees") angle int }
    member function declare end
class end
```

In C#:

```csharp
class AnglePrinter
{
    private static string rightAlias = "right";
    private static int rightAmount = 90;

    public string PrintAngle(int angle)
    {
        if (angle == AnglePrinter.rightAmount)
        {
            return AnglePrinter.rightAlias;
        }

        return string.Format("{0} degrees", angle);
    }
}
```

In Python:

```python
class AnglePrinter:
    __right_alias = "right"
    __right_amount = 90

    def print_angle(self, angle):
        if angle == AnglePrinter.__right_amount:
            return AnglePrinter.__right_alias

        return "{0} degrees".format(angle)
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.budgielang.org/syntax/classes/static-variables.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
