Question: Write a class called Rectangle that contains the following information: 1. Private instance variables for the height and width of the rectangle (int). 2.
Write a class called Rectangle that contains the following information: 1. Private instance variables for the height and width of the rectangle (int). 2. A two-argument constructor to set each of the instance variables above. If the height or width is negative, throw an IllegalArgumentException stating the argument that is not correct. 3. Get and Set methods for each instance variable with the same error detection as the constructor. public class Rectangle {
Step by Step Solution
There are 3 Steps involved in it
Code for Rectangle class public class Rectangle instance variables private int height private int wi... View full answer
Get step-by-step solutions from verified subject matter experts
