E
Ejeep
I have a strange issue.When I use "This" to output the current object,
the console outputs the other object.
Who can help me analyse it?Why could it happen?
Please see the example below.
The normal output is: fh.a --this:fh@9d6
but sometimes the output is: fh.a --this:an@c10
public class fh
{
public fh(Image image)
{
a = image;
}
public void a(Graphics g1, int j, int k)
{
System.out.println("fh.a --this:"+this);
g1.drawImage(a,......);
}
private Image a;
}
the console outputs the other object.
Who can help me analyse it?Why could it happen?
Please see the example below.
The normal output is: fh.a --this:fh@9d6
but sometimes the output is: fh.a --this:an@c10
public class fh
{
public fh(Image image)
{
a = image;
}
public void a(Graphics g1, int j, int k)
{
System.out.println("fh.a --this:"+this);
g1.drawImage(a,......);
}
private Image a;
}