public class eg16_Rectangle { private String name; private double length; private double width; public eg16_Rectangle (String na, double len, double wid) //constructor { name = na; length = len; width = wid; } public String getName () { return name; } public double getLength () { return length; } public double getWidth () { return width; } public void setLenWid (double Len, double Wid) { length = Len; width = Wid; } //create this one last as a seperate exercise public String toString() { String str = "\n" + name +"\nLength: "+ length + "\nWidth: "+ width; return str; } //used to compare 2 objects, cannout use == for reference types public boolean equals (eg16_Rectangle object2) { boolean status; if (name.equals(object2.name) && length==(object2.length) && width==(object2.width)) status = true; else status = false; return status; } //Copy constructor, use to copy object, //a constructor that accepts an object of the same class as a argument public eg16_Rectangle(eg16_Rectangle object2) { name = object2.name; length = object2.length; width = object2.width; } }