What is the default value of a boolean instance variable in Java?

The story behind the answer

The default value of a boolean instance variable in Java is false.

This initialization happens automatically when a new object is created and its instance fields receive default values. Java’s other primitive defaults include zero for numeric types and the null character for char; reference-type fields receive null.

The rule applies to fields, including instance variables, class variables, and array components. It does not apply in the same way to local variables: a local boolean declared inside a method must be definitely assigned before the compiler allows it to be read.

false is a boolean value, not the numeric value 0 and not the reference value null. Java keeps boolean as a distinct primitive type with the two values true and false, although the JVM may use implementation-level representations such as integer-like values internally. Explicit initialization is still often preferred because it communicates intent and avoids confusion between field defaults and local-variable rules.

Source: Wikipedia · fact-checked Aug. 2026

Add question to a list

Choose a list to keep this question in: