# Top-Level Statements

*noun*

say it: **“TOP LEV-ul STAYT-ments”** **/tɒp ˈlɛvəl ˈsteɪtmənts/**

Writing a C# program's code straight in the file, without a Program class or a Main method around it.

## What is **Top-Level Statements** in C#?

**Top-Level Statements** — A feature that allows a small C# program to omit an explicit Program class and Main method.

```csharp
class Program
{
    static void Main()
    {
        string message = "Hello, C#!";
    }
}
```

## In a sentence

- “Thanks to **top-level statements**, my first program was one line: Console.WriteLine("Hi");.”

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

Updated: November 9, 2026

Source: https://www.ask-codey.com/glossary/top-level-statements
