What is the difference between NULL and zero ?? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 9

What is the difference between NULL and zero ??

Problem 236+java

28th Apr 2017, 11:25 AM
Pāˆ†WAN Māˆ†URYāˆ†
Pāˆ†WAN Māˆ†URYāˆ† - avatar
6 Respostas
+ 19
When an object reference variable is not initialized the variable is not pointing to an object. It is NULL. When an primitive numeric variable is not initialized its default value is zero.
29th Apr 2017, 4:50 AM
NimWing Yuan
NimWing Yuan - avatar
+ 9
Zero is a value. NULL means an absent value.
28th Apr 2017, 11:39 AM
visph
visph - avatar
+ 4
Zero is a defined int with value 0 NULL is a undefined variable contains no value.
28th Apr 2017, 11:40 AM
CalviÕ²
CalviÕ² - avatar
+ 4
NULL means UNDEFINED (dividing a/0 will give undefined) ZERO is an integer which means the number 0
28th Apr 2017, 12:49 PM
Siddharth Saraf
+ 3
NULL means no value as in "unassigned".Ā  An object that is not instantiated should be NULL.Ā  But in databases NULL means unassigned = no valueĀ  It is different from 0 which is a value that can be count
28th Apr 2017, 11:49 AM
é»ƒå† čž
é»ƒå† čž - avatar
+ 3
Just like the difference between white and transparent. White is no color. Transparent is colorless.
28th Apr 2017, 11:54 AM
K.C. Leung
K.C. Leung - avatar