Construct a class called Rectangle. A Rectangle has both a length and a width (both positive integers). Access to them should be only inside the class and within the inheritance hierarchy. Then implement the following:
public class Rectangle {
protected int height1;
protected int height2;
protected int width1;
protected int width2;
}
Comments
Leave a comment