nonempty
operator
The non-associating, unary postfix nonempty
operator is used to test its operand for
emptiness.
Usage
void m(Integer[] nums) {
Boolean haveNums = nums nonempty;
}
Description
Definition
The meaning of nonempty
is defined as follows:
if (nonempty lhs) true else false
See the language specification
for more details.
Polymorphism
The nonempty
operator is not polymorphic.
Type
The result type of the nonempty
operator is Boolean
.
Note
Do not to confuse the nonempty
operator described here and which
takes postfix form attribute nonempty
with the
nonempty
condition used in if
, assert
and
while
statements and which takes the prefix form
nonempty attribute
.
See also
-
nonempty
in the language specification. - operator precedence in the language specification