Short IF - ELSE statement

前端 未结 6 1896
萌比男神i
萌比男神i 2020-11-27 04:15

I\'m trying to make my code more readable, so I decided to use some short IF statements.

Here\'s my code which doesn\'t work (\"not a statement\"):

         


        
6条回答
  •  迷失自我
    2020-11-27 04:30

    The ternary operator can only be the right side of an assignment and not a statement of its own.

    http://www.devdaily.com/java/edu/pj/pj010018/

提交回复
热议问题