public class Rectangle extends Parallelogram { // Class variable: protected final static double rightAngle = Math.PI/2; // Constructors: public Rectangle(double width, double height) { super.setWidth(width); super.setHeight(height); super.setAngle(rightAngle); } public Rectangle(Dimension d) { super.setDimension(d); super.setAngle(rightAngle); } public Rectangle() { } // Encapsulate the instance variables: public void setWidth(double width) { super.setWidth(width); super.setAngle(rightAngle); } public void setHeight(double height) { super.setHeight(height); super.setAngle(rightAngle); } public void setDimension(double width, double height) { super.setDimension(width, height); super.setAngle(rightAngle); } public void setDimension(Dimension d) { super.setDimension(d); super.setAngle(rightAngle); } }