undefined variables are those that are not assigned any value but declared in the program.
if we try to read the value, an error message "undefined" is displayed.
undeclared variables are those that are not declared in the program .
if we try to read their values gives runtime error.
But if undeclared variables are assigned some value then implicit declaration is done .
//a is undefined variable
//b is undeclared variable
b:will also be undefined but that error message can be seen by clicking in browser
status bar: if some value is assigned to b, then it will be displayed in the output
Asked In: Many Interviews |