Difference between undefined and undeclared variables.
Interview question and answer by: Ddd
| Views: 3236 | | Points: 40
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
| Alert Moderator
Found interesting? Add this to: