---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 26 Edition"
java_version: 26
chapter: "Chapter 5. Conversions and Contexts"
section: "5.4"
heading: "5.4. String Contexts"
parent: "Chapter 5. Conversions and Contexts"
source: https://docs.oracle.com/javase/specs/jls/se26/html/jls-5.html#jls-5.4
id: "5.4"
url: https://jvm.obfuscated.software/jls/se26/5.4.html
raw: https://jvm.obfuscated.software/jls/se26/5.4.md
---

# 5.4. String Contexts

String contexts apply only to an operand of the binary `+` operator which is not a `String` when the other operand is a `String`.

The target type in these contexts is always `String`, and a string conversion ([§5.1.11](5.1.11.md)) of the non-`String` operand always occurs. Evaluation of the `+` operator then proceeds as specified in [§15.18.1](15.18.1.md).
