Undefined value: A value that is not defined and has no keyword is known as undefined value. For example in the declaration, int number; the number has undefined value.
Null value: A value that is explicitly specified by the key word ‘null’ is known as null value. For example in the declaration, String str=null; the str has a null value. The keyword ‘null’ is used here.
null value has keyword called ‘null’. That is not the case with undefined.
typeof undefined variable or property returns undefined whereas
typeof null value returns object.
typeof null value returns object.

0 Comments:
Post a Comment