Why were the innermost set of parentheses used in the statement:
System.out.println("The original : " + (quotient*3 + remainder) );
Without the parentheses, Java would
take the first + to mean
"convert quotient*3 to characters and append them to the string".
Then it would
take the second plus to mean "convert remainder
to characters and
append them to the string.
The arithmetical addition would not be done.
The integer division operator / and the remainder operator % take an integer apart.
theInteger / divisor ——> quotient theInteger % divisor ——> remainder
The original integer can be put back together again:
quotient * divisor + remainder ——> theInteger
In many calculations, it is convenient to do everything with integers, so both / and % are needed.