What can you do with a variable holding null?

First, if the variable is not final, you can use it as an L-value of the corresponding type - assigning a new value to it.

Second, you can do the same things you would with the null literal, but considering the type:
  • Compare it to null or another variable of the same class.
  • Cast it to a parent type (upcast) or a subclass (downcast), considering the boundaries of generic parameters, if applicable.
  • Access instance members and trigger a NullPointerException.
  • Apply instanceof, which will return false.
  • Pass it as a parameter to methods or use it in other operators compatible with the type.
Third, you can access static members of the class. This is the interesting part of the question. It’s safe to do so - you won't get a NullPointerException - but for the sake of debugging and to avoid confusion due to the lack of overriding for static members, it’s recommended not to do this. Instead, access statics explicitly through the class name or implicitly by adding import static.