# Local Variable

A variable declared inside a method or block and usable only there.

## What is **Local Variable** in C#?

**Local Variable** — A variable declared inside a method or block and usable only there.

```csharp
class Game
{
    void UpdateScore()
    {
        int score = 10;
        score = score + 5;
    }
}
```

Level: Apprentice · [More C# terms at this level](https://www.ask-codey.com/glossary/subjects/c-sharp/apprentice)

Updated: September 27, 2026

## In other subjects

- [Local Variable in Java](https://www.ask-codey.com/glossary/local-variable-java)

Source: https://www.ask-codey.com/glossary/local-variable-c-sharp
