/*
Class: ClassTemplate
Author: Your_Name(s)
with assistance from: people who helped (including instructor/TAs)
Creation date: date
Modifications:
Date Name reason
---- ---- ------
*/
// Package declaration goes here.
// package Package_Name;
// Import statements go here.
// import java.io.*;
// import java.util.*;
import java.awt.Color;
/**
One-sentence description of role or purpose of objects of this
class goes here.
A more detailed description goes here, if necessary.
@author Your_Name
@author Your_Partner
*/
public class ClassTemplate
{
// Encapsulated instance variables and shared class variables go here.
private Color myColor; // the color of this object
// Constructors
/** Constructs a new ClassTemplate object.
(Post: A subsequent call to color() would return
initColor.)
@param initColor initial color for this object
*/
public ClassTemplate(Color initColor)
{
myColor = initColor;
}
// Methods
/** Determines the color of this object.
@return the color of this object
*/
public Color color()
{
return myColor;
}
/** Changes the object's color.
(Post: A subsequent call to color() would return
newColor.)
@param newColor new color for this object
*/
public void setColor(Color newColor)
{
myColor = newColor;
}
}