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 is the default initialization value for a boolean field in a class?

  1. true

  2. false

  3. 1

  4. null

The correct answer is: false

When boolean fields are declared in a class without an initial value, they will be automatically initialized to the "false" value. For this reason, choice B is the correct answer. A, C, and D are incorrect because they do-not represent the default initialization value for boolean fields in a class. Choice A is a possible value, but is not the default. Choice C is a numeric value and not a boolean value, and choice D is used for object types and not boolean primitives. Therefore, B is the correct choice.