What is the Java ?: operator called and what does it do?
Yes, it is a shorthand form of int count; if (isHere) count = getHereCount(index); else count = getAwayCount(index); It’s called the conditional operator. Many people (erroneously) call it the ternary operator, because it’s the only ternary (three-argument) operator in Java, C, C++, and probably many other languages. But theoretically there could be another ternary operator, … Read more