1. Year represented as a simple Whole Value.

Listing 1. Year represented as a simple Whole Value.


public final class Year
{
    public static Year valueOf(int year)
        { return new Year(year); }
    public Year(int year) { value = year; }
    public int getValue() { return value; }
    private final int value;
}

About the Author

Kevlin Henney is a Principal Technologist with QA Training in the UK.