Default values for data types in Java - ilya-khadykin/notes-outdated GitHub Wiki
The following chart summarizes the default values for the above data types.
Local variables are slightly different; the compiler never assigns a default value to an uninitialized local variable. If you cannot initialize your local variable where it is declared, make sure to assign it a value before you attempt to use it. Accessing an uninitialized local variable will result in a compile-time error.
References
- The Java® Tutorial: A Short Course on the Basics, Sixth Edition