hi. i got the task right, (you can see the if/else statement commented out), but afterwards i wanted to use the ternary operator instead. i can't seem to get it right as the statement gets an error that the void type isn't allowed here. can anyone help me understand what's going on and let me know how to use it correctly? public class Solution { public static void main(String[] args) throws Exception { int sum = 0; BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); boolean test = true; while (test){ String nextString = reader.readLine(); // here is the old if statement /*if (nextString.equals("sum")){ System.out.println(sum); test = false; } else { sum += Integer.parseInt(nextString); }*/ // and here is the attempt to convert it.this line spits error. (nextString.equals("sum"))?(System.out.println(sum)) && (test = false):sum += Integer.parseInt(nextString); } } }