Question: Language Java: Add a method public void translate(int a, int b) that makes a translation of the rectangle that adds a to x and b
Language Java:
Add a method public void translate(int a, int b) that makes a translation of the rectangle that adds a to x and b to y.
public class Rectangle {
public Rectangle(int x, int y, int width, int height) {
this.x = x; this.y=y; this.width= width; this.height=height;
}
int x, y, width, height;
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
