Mastering Java: The Ultimate Quiz for 'Thinking in Java'

Disable ads (and more) with a membership for a one time $2.99 payment

Mastering Java: The Ultimate Quiz for 'Thinking in Java'. Dive deep into Java with multiple-choice questions. Challenge yourself with quiz questions designed to test and improve your understanding of the 'Thinking in Java' book. Get ready for your exam!

Practice this question and more.


What does the decrement operator (--) signify?

  1. Increase by one unit

  2. Multiply by two

  3. Decrease by one unit

  4. Divide by two

The correct answer is: Decrease by one unit

The decrement operator (--) decreases the value of a given variable by one unit. It does not increase the value (option A) nor does it multiply or divide the value (options B and D). The only action the decrement operator performs is decreasing the value by one unit. It is important to note that this operator only works on numerical variables, as it cannot be applied to string or boolean data types. Therefore, the correct answer is C Decrease by one unit.