They are null by default for objects, 0 for numeric values and false for booleans. For variables declared in methods – Java requires them to be initialized. Not initializing them causes a compile time error when they are accessed.
They are null by default for objects, 0 for numeric values and false for booleans. For variables declared in methods – Java requires them to be initialized. Not initializing them causes a compile time error when they are accessed.