So the short answer is use .class for the known, existing object?
So for my use it may look something like this:
if (incomingObject.getClass() == map[0][0].class()) {
// Note the null check is...
Type: Posts; User: srs
So the short answer is use .class for the known, existing object?
So for my use it may look something like this:
if (incomingObject.getClass() == map[0][0].class()) {
// Note the null check is...
Thanks for the instancoof suggestion. By it's name, I thought it would work, but seems this is not so.
class Parent {
public Parent() {
}
}
class Child extends Parent {
public Child() {...
I have an incoming object of an unknown class (null possible). I need to test if the object is of a specific class.
if (incomingObject.getClass() == map[0][0].getClass()) {
// go go go!
}...