+ 2
What is the value of null? and why?
7 Answers
+ 3
The random value is due to a section of memory being asigned to the declared variable. That section of memory may have any combination of 0 and 1 as these bits have not been overwritten. But null per se does not represent a random value.
+ 2
Null has no value. When asigned to a variable, it indicates the absence of value of that variable. That variable will be declared and accessible but it stores nothing
+ 2
In C and C++, NULL is 0.
+ 2
@Schindlabua thanks for pointing that out.
In the languages I know well it works that way. So it may vary between languages
+ 1
generally it is said that null has no value , but that's not the truth , its an indeterminate random value .
+ 1
That is true. It does actually have a random value but it still represents absence.
0
Null simply means the absence of a value.