What errors?
You would want to set an object to null, for example, if you wanted to be accessible by the entire class, but only initialized after a certain event or something occurs. You could...
Type: Posts; User: aussiemcgr
What errors?
You would want to set an object to null, for example, if you wanted to be accessible by the entire class, but only initialized after a certain event or something occurs. You could...
nope, it's the same thing, but that's only because Objects are set to null when not initialized. The same is not true for primitives like ints and doubles. For ints, these two are the same:
...
The variable would be set to null, meaning it has not been initialized. If you attempted to invoke any methods on the variable (such as the toString() method), a Null Pointer Exception will be thrown...