Multiple choice java

The ?: operator is an example of which kind of operator?

  1. Binary

  2. Prefix

  3. Postfix

  4. Infix

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The ?: operator (ternary operator) is an infix operator because it appears between its three operands: condition ? value_if_true : value_if_false. Binary operators have two operands, while prefix/postfix operators have one operand and appear before or after it.