Java Program 1
public class GeometricObject { private String color = "white"; private boolean filled; private java.util.Date dtCreated; //Default constructor GeometricObject(){ dtCreated = new java.util.Date(); } //Regular constructor GeometricObject( String clr, boolean fld ){ dtCreated = new java.util.Date(); this.color = clr; this.filled = fld; } //Get functions public String getColor() { return color; } public boolean isFilled() { return filled; } public java.util.Date getDateCreated(){ return dtCreated; } //Set functions public void setColor( String clr) { this.color = clr; } public void setFilled( boolean fld) { this.filled = fld; } //Print Object public String toString() { return( "Created on: " + dtCreated + "\n" + "Color = " + color + "\t Filled = " + filled ); } }