0
Why i would need to use "Null"?
can u post a simple real code in which u used "Null" and explain to me how does it work in the code and why u used it ?
6 Respostas
+ 6
Null just means nothing. In a real-world context, null can be useful when you want to test if something is empty or not-defined.
For example, if I want to search a user from the list, I could use "null" in the if-else statement first to ascertain that the list exists in the first place.
+ 4
placeholder for most data types or unsetting an object, like killing a pdo connection
+ 3
Why we would need to use "Zero" ( 0 )?
Zero is useful for saying 'nothing' when we know the quantity/number is really zero.
But it can be also useful to have another value, which could say that we don't know the count: zero, in this case, isn't really the same.
So, a value as 'Null' allows to assign to variables a non-value ^^
+ 2
is this question related to a specific language, or any language in general?
0
C#
0
thanks for ur answers, all of u really helped me understanding "Null"