CSC1109_Tutorials/Week5_Lab/GeometricObject/GeometricObject.java

45 lines
1005 B
Java

package Week5_Lab.GeometricObject;
public class GeometricObject {
private String color;
private boolean filled;
private java.util.Date dateCreated;
public GeometricObject() {
//this.color = "white";
//this.filled = false;
this("white", false);
this.dateCreated = new java.util.Date();
}
public GeometricObject(String color, boolean filled){
this.color = color;
this.filled = filled;
this.dateCreated = new java.util.Date();
}
public String getColor() {
return color;
}
public void setColor(String color) {
this.color = color;
}
public boolean isFilled() {
return filled;
}
public void setFilled(boolean filled) {
this.filled = filled;
}
public java.util.Date getDateCreated() {
return dateCreated;
}
public String toString(){
return " created on " + dateCreated + "\ncolor: " + color + " and filled: " + filled;
}
}