The following chart summarizes the default values for the above data types.
Data TypeDefault Value (for fields)byte0short0int0long0Lfloat0.0fdouble0.0dchar'/u0000'String (or any object) nullbooleanfalse
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.
