This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Correct. You can't put statements in the ternary operator, only values. These values may be the results of method calls but they must still be values. That means you can't put a System.out.println() or a throw statement there.
I'm afraid you will need to use a normal if-statement here: