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

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

Dive into the depths of Java with our quiz based on "Thinking in Java, Fourth Edition" by Bruce Eckel. Test your knowledge, solidify concepts, and prepare for certification with challenging questions and insightful feedback.

Each practice test/flash card set has 50 randomly selected questions from a bank of over 500. You'll get a new set of questions each time!

Practice this question and more.


What does the NOT (!) logical operator do to its boolean argument?

  1. Inverts the value

  2. Sets it to false

  3. Increments the value

  4. Decreases the value

The correct answer is: Inverts the value

The NOT logical operator inverses the boolean value of its argument. This means that if the argument is true, the result will be false, and vice versa. Options B, C, and D are incorrect because they do not involve inverting the value of the boolean argument. Setting it to false, incrementing or decreasing the value are all different operations that do not result in inversion.