10 Weird Facts About null in Java

preview_player
Показать описание
Let's face it, null in Java is weird... and it works in some strange ways. Here I present 10 weird facts about Java's null. Let me know if you know any other weird facts about null.

------------------------------

------------------------------

Рекомендации по теме
Комментарии
Автор

Incredibly interesting facts. This guy knows his stuff!!

littlemissquery
Автор

As a C++ programmer transitioning to Java I always used to do this

if (!root) {//then do for non-null root}

But learned hard way that in java you always need to do
if (root != null) {//then do for non-null root}

thevagabondyt
Автор

if (root == null) return null;

if (root == null) return root;


which one should be preferrable (from memory/space efficiency point of view) ? or both are same efficiency ?

thevagabondyt