Similar to the Java keywords public, static, and final, null is also a keyword. It merely serves as a value to demonstrate that the object is meaningless. The term “null” was first created to signify a lack of something. For instance, the lack of a resource, a user, or anything else. When a reference variable doesn’t point to any value it is assigned null.
Generally speaking, null is used as a special value to signify:
Uninitialized state
Termination condition
Non-existing object
An unknown value
Properties of null
null as a default
null is used for casting to other types
null as an instanceOf operator
If initialized after being declared, every primitive type of variable has a default value (for example, it has 0, and boolean has false). Any reference type variable that is not initialized at the time of declaration will also have null as its default value. The compiler will alert you if you use a local variable without initializing it, however, this is true for all types of variables, instance variables, or static variables.