# Literal

*noun*

say it: **“LIT-er-ul”** **/ˈlɪtərəl/**

A value typed straight into your code, such as 42, 3.14, true or "hello", rather than worked out or read from somewhere.

## What is **Literal** in Java?

**Literal** — A value written directly in source code, such as 42, true, or "hello".

```java
class Order {
    int itemCount = 3;
    double price = 4.50;
    char size = 'M';
    boolean paid = true;
}
```

## In a sentence

- “The 18 in age >= 18 is a **literal**; it would be clearer as a named constant.”

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

- [Literal in C#](https://www.ask-codey.com/glossary/literal-c-sharp)

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