문제

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