B
buu
Is there an any kind of checking if some object exist?
something like IsNothing check or somethin'??
something like IsNothing check or somethin'??
buu said:Is there an any kind of checking if some object exist?
something like IsNothing check or somethin'??
Arne Vajhøj said:if(o != null)
Arne
buu said:what about java.lang.class.IsInstance?
what about java.lang.class.IsInstance?
if ( o instanceof MyClass)
// stuff
which returns true if o is an instance of MyClass or some subclass of
MyClass. This isn't what you want, because
(i) o may be an instance of some class which is unrelated to MyClass and
still not be null, and
(ii) o instanceof java.lang.Class would throw a runtime exception
(actually
a NullPointerException) if o was null.
buu said:Is there an any kind of checking if some object exist?
Stefan said:An object always exists.
If it would not exist, it would not be an object.
buu said:Is there an any kind of checking if some object exist?
something like IsNothing check or somethin'??
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.