# String Interpolation

Inserting values into text; Java normally uses formatting methods rather than interpolated string literals.

## What is **String Interpolation** in Java?

**String Interpolation** — Inserting values into text; Java normally uses formatting methods rather than interpolated string literals.

```java
class Order {
    String describe(String item, int count) {
        return "%d cups of %s".formatted(count, item);
    }
}
```

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

Updated: September 27, 2026

## In other subjects

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

Source: https://www.ask-codey.com/glossary/string-interpolation
