Chapter 3: Data Abstraction

Exercise 2.1. static Point translate3(Point p, int dx, int dy) { // input: a nonnull point p, and two integers dx and dy // side effect: translates point p by dx and dy // output: point p after it is translated p.setX(p.getX() + dx); p.setY(p.getY() + dy); return p; } ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download