# Declaration

*noun*

say it: **“dek-luh-RAY-shun”** **/ˌdɛkləˈreɪʃən/**

The line that introduces a new variable, method or class by giving it a type and a name, so the rest of the code can use it.

## What is **Declaration** in Java?

**Declaration** — A statement that introduces a variable, method, class, or other named item.

```java
class Game {
    void updateScore() {
        int score = 10;
        score = score + 5;
    }
}
```

## In a sentence

- “The **declaration** String city; tells Java a text variable called city exists, though it holds nothing yet.”

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

Updated: October 26, 2026

## In other subjects

- [Declaration in C#](https://www.ask-codey.com/glossary/declaration-c-sharp)
- [Declaration in CSS](https://www.ask-codey.com/glossary/declaration-css)

Source: https://www.ask-codey.com/glossary/declaration
