# var

A reserved type name that asks the compiler to infer a local variable's type.

## What is **var** in Java?

**var** — A reserved type name that asks the compiler to infer a local variable's type.

```java
class City {
    void normalizeName() {
        var name = "Denver";
        var uppercaseName = name.toUpperCase();
    }
}
```

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

Updated: September 28, 2026

## In other subjects

- [var in C#](https://www.ask-codey.com/glossary/var-c-sharp)
- [var in JavaScript](https://www.ask-codey.com/glossary/var-javascript)

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