WHAT IS THE DIFFERENCE BETWEEN UNDEFINED VALUE AND NULL VALUE?

James Smith

Total Post:157

Points:785
Posted by  James Smith
 1535  View(s)
Ratings:
Rate this:
  1. James Smith

    Post:157

    Points:785
    What is the difference between undefined value and null value?

    Undefined value having no keyword and not defined is known as undefined value. While declaring a variable it does not contain any value hence it is called as undefined value. Null value has to be specifically declared as null indicating that the variable doesn’t point at any particular location in memory. For example String str = null; declares variable str which references null.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!