The second statement is valid:
System.out.println((grade/=3) + "%");
Here the (grade/=3)
is calculated first and then %
is appended.
But the
System.out.println(("Apples") System.out.println("Oranges"));
is invalid statement. For this case compiler generates compilation errors like :
error: ')' expected
error: illegal start of expression
error: ';' expected
solved Why does this statement work in Java?