三目運算符?:

Java支持三元運算符。 表達式 condition ? expression1 :expression2 當條件condition爲真時計算第1個表達式,否則計算第2個表達式。列如: x < y ? x : y 返回x和y中較小的值。 living example:
相關文章
相關標籤/搜索