A value of “0” and null are not the same and will behave differently. variableName = null;
variableName == null; You can also use “!=” to check that a value is NOT equal.
For example, if the value is null, then print text “object is null”. If “==” does not find the variable to be null, then it will skip the condition or can take a different path. Object object = null ; if ( object == null ) { System. out. print ( “object is null “); }
string() means the value is null until it is actually used.
For example: do something while object is null or do nothing until an object is NOT null. synchronized method() { while (method()==null); method(). nowCanDoStuff(); }