Skip to content

Glossary: Java Basics

Ternary operator

Also written: ?:

A quick two-way choice, `condition ? a : b`, that gives `a` if true and `b` if false.

Where the book teaches it

Related terms

Switch expressionCondition