# String Interpolation

say it: **“string in-ter-puh-LAY-shun”** **/strɪŋ ɪnˌtɜːrpəˈleɪʃən/**

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?category=java&level=2)

Updated: November 17, 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)
- [String Interpolation in PowerShell](https://www.ask-codey.com/glossary/string-interpolation-powershell)

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