The Student Room Group

Java Programming

How do i explain this program like i know s = 0. I dont know how to explain it?
Reply 1
Well it's a conditional statement, like an IF statement, that returns a value, s, which depends on the outcome of boolean expressions involving the input, y. It's basically just a series of IF statements compressed to one line via synctactic sugaring.

It will return the first value whose boolean statement returns true and store that value in s.

Quick Reply

Latest