I am trying to learn Java programming. A book I am reading asks that I create a program that will sum only the odd numbers from 1 to 1000. I am to use a Boolean variable and the ternary operator.
I have read a bit and researched the ternary operator, but am at a loss on how to use a boolean variable to get this information.
Can anyone give a suggestion?