Вопрос

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.

Это было полезно?

Решение

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 :-)

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top