If you declare an object like so:
Object x;
does it initialize as null?
For example, will (x == null) be true?
If x is a field, it will be null by default. If it is a local variable, you have to explicitly initialize it before you use it. This is outlined in JLS §4.12.5: Initial Values of Variables.
member variables are initialized to null and local variables are not initialized and the initial value is set by you.
Note:- null is definitely a value. Its the value which doesnt refer to any object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With