Are nil and null interchangeable? For example,
My bank a/c has a nil balance.
My bank a/c has a null balance.
Are nil and null interchangeable? For example,
My bank a/c has a nil balance.
My bank a/c has a null balance.
NULL is used in computing most often (always?) to signify "not a value." This is different than zero: in a bank database, a zero value means no money, while a NULL value means there has been no value assigned to the balance.
This is a specialized usage, but increasingly common as more people learn to program.
((void*)0) (which many do), which you then can't use in e.g. arithmetic: 5*NULL will give you a compilation error.
– Ruslan
Jul 09 '17 at 09:29
Nil means zero or nought
Null means nothing or empty
In everyday life, we tend to treat these terms as equivalent. But it is sometimes important to differentiate between them. (E.g. when working with SQL database data)
Almost the only time you hear or see null is in the legal expression ‘null and void’, while nil normally indicates that a football team has scored no goals. If the bottom line of your bank statement shows neither a credit nor a debit, what you have is a zero balance.
Null is also used in mathematics (a null set) and science (null hypothesis). I can't think of a time when nil is used in those areas.
Etymologically, null is from French, and nil is from Latin.
Null is also used in physics and electronics. Here's a description of a Null comparator using a Wheatstone bridge. Null tends to describe something with no net value, but possibly the sum of large values of opposing signs, while nil implies a value of 0.
Nil means no less than or greater than 0 and null means no value in variable or any storage media