Rectangle rect = new Rectangle(20, 20, 30, 30); rect.translate(10, 5);
Rectangle rect = new Rectangle(0, 0, 40, 40); rect.translate(-50, -20);The java.awt.Rectangle class is part of the standard Java library, which is included in the java.awt package.