0% found this document useful (0 votes)
6 views1 page

Java Geometric Object Class Overview

The document defines a GeometricObject class with color, filled, and dateCreated properties and getters and setters for these. It contains two constructors, one that takes color and filled as parameters and one default. It overrides the toString method.

Uploaded by

Anna Hnin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

Java Geometric Object Class Overview

The document defines a GeometricObject class with color, filled, and dateCreated properties and getters and setters for these. It contains two constructors, one that takes color and filled as parameters and one default. It overrides the toString method.

Uploaded by

Anna Hnin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

package [Link].

inheritance;

import [Link];

public class GeometricObject {


private String color;
private boolean filled;
private Date dateCreated;

public String getColor() {


return color;
}
public void setColor(String color) {
[Link] = color;
}
public boolean isFilled() {
return filled;
}
public void setFilled(boolean filled) {
[Link] = filled;
}
public Date getDateCreated() {
return dateCreated;
}
public GeometricObject(String color, boolean filled) {
[Link] = color;
[Link] = filled;
[Link] = new Date();
}
public GeometricObject() {
[Link] = "white";
[Link] = false;
[Link] = new Date();
}

@Override
public String toString() {
return "created on "+dateCreated +"\ncolor ="+
color+" and filled"+filled;
}
}

You might also like