Question

I know there is this method:

pt.translate(int x, int y);

But is there this method:

pt.translate(Point anotherPoint);

Would be the same as saying:

pt.translate(anotherPoint.x, anotherPoint.y);

But I thought there might be that method because it is simpler.

Était-ce utile?

La solution

According to the docs, that is the only translate method. So, as you've said,

pt.translate(anotherPoint.x, anotherPoint.y);

is what you're looking for.

Also, accessing the fields of an object is just about as simple as it gets :-)

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top