Rectangle - return height public int getArea return width...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
package lab09; p public class Rectangle { private int width; private int height; public Rectangle(int givenWidth, int givenHeight) { width = givenWidth; height = givenHeight; } public int getWidth() { return width; } public int getHeight() {
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: return height; } public int getArea() { return width * height; } public int getPerimeter() { return width * 2 + height; } public boolean isSquare() { return width == height; } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online