is possible to know in a class who has instanced itself? I have a class Listener that can be instanced by a lot of other classes, so inside Listener I would to know who is the "father";
i don't want to use
if(objectA instanceOf Class)
....
but i think something like this:
if(this.instanceOf Class1)
System.out.println("Hello i'm the class Listener instanced by Class1);
else if(this.instanceOf Class2)
System.out.println("Hello i'm the class Listener instanced by Class2);
Is this possible or am I idiot? ;) thanks Nicola