Is null and 0 equal in java?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is null and 0 equal in java??

6th May 2017, 8:00 AM
Vishnuvasan
Vishnuvasan - avatar
8 Answers
+ 8
@Alexey congrats for your epic badge
6th May 2017, 2:37 PM
Vaibhav Sharma
Vaibhav Sharma - avatar
+ 6
no, zero is not null.
6th May 2017, 8:06 AM
The Coding Sloth
The Coding Sloth - avatar
+ 6
"0" is zero "null" is a special value For object type null is an empty reference.
6th May 2017, 8:25 AM
Alexey
Alexey - avatar
+ 6
Both are different, null means that a reference that points nowhere. 0 is a numeric value
6th May 2017, 11:46 AM
Vishnu C Nair
Vishnu C Nair - avatar
+ 1
null is nothing, no value. Zero is a value even if its zero.
6th May 2017, 8:24 AM
Mogammad Shameer Losper
Mogammad Shameer Losper - avatar
+ 1
so they both were different...
6th May 2017, 12:03 PM
Vishnuvasan
Vishnuvasan - avatar
0
no both are different.
6th May 2017, 8:41 AM
MR Programmer
MR Programmer - avatar