how can you test if a primitive has not been intialized?
" " " " " " reference " " " " ?
Printable View
how can you test if a primitive has not been intialized?
" " " " " " reference " " " " ?
the compiler should throw an error if there is a chance a primitive wasn't initialized, so there really is know need for that.
:)
alirght, but what if i need to know if a reference is set to null?
<which i do>
what do you mean by reference? Like if an object is passed into a function and is null?
public void doSomething(Object o)
{
if (o == null)
{
System.out.println("Null!!");
return;
}
}
??
i thought it was gonna be something more difficult. LMFAO!