---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 14 Edition"
java_version: 14
chapter: "Chapter 15. Expressions"
section: "15.23"
heading: "15.23. Conditional-And Operator &&"
parent: "Chapter 15. Expressions"
source: https://docs.oracle.com/javase/specs/jls/se14/html/jls-15.html#jls-15.23
id: "15.23"
url: https://jvm.obfuscated.software/jls/se14/15.23.html
raw: https://jvm.obfuscated.software/jls/se14/15.23.md
---

# 15.23. Conditional-And Operator `&&`

The conditional-and operator `&&` is like `&` ([§15.22.2](15.22.2.md)), but evaluates its right-hand operand only if the value of its left-hand operand is `true`.

```
ConditionalAndExpression:
  InclusiveOrExpression
  ConditionalAndExpression && InclusiveOrExpression
```

The conditional-and operator is syntactically left-associative (it groups left-to-right).

The conditional-and operator is fully associative with respect to both side effects and result value. That is, for any expressions `a`, `b`, and `c`, evaluation of the expression `((a) && (b)) && (c)` produces the same result, with the same side effects occurring in the same order, as evaluation of the expression `(a) && ((b) && (c))`.

Each operand of the conditional-and operator must be of type `boolean` or `Boolean`, or a compile-time error occurs.

The type of a conditional-and expression is always `boolean`.

At run time, the left-hand operand expression is evaluated first; if the result has type `Boolean`, it is subjected to unboxing conversion ([§5.1.8](5.1.8.md)).

If the resulting value is `false`, the value of the conditional-and expression is `false` and the right-hand operand expression is not evaluated.

If the value of the left-hand operand is `true`, then the right-hand expression is evaluated; if the result has type `Boolean`, it is subjected to unboxing conversion ([§5.1.8](5.1.8.md)). The resulting value becomes the value of the conditional-and expression.

Thus, `&&` computes the same result as `&` on `boolean` operands. It differs only in that the right-hand operand expression is evaluated conditionally rather than always.
