FileDocCategorySizeDatePackage
FinalMembers.javaAPI DocExample3738Sun Dec 14 22:47:38 GMT 2003oreilly.hcj.finalstory

FinalMembers

public class FinalMembers extends Object
Demonstration of final class members.
author
Robert Simmons jr. (kraythe)
version
$Revision: 1.3 $

Fields Summary
private Date
creationDate
Holds the creation date-time of the instance.
public Date
modificationDate
Holds the modification date-time of the instance.
private final Date
creationDate2
Holds the creation date-time of the instance. A protected version of createDate.
private final Date
creationDate3
Holds the creation date-time of the instance.
Constructors Summary
public FinalMembers(Date creationDate, Date modificationDate)
Constructor

param
creationDate The creation date.
param
modificationDate The last modification date.
throws
IllegalArgumentException if modificationDate is less than creationDate.


	                     	 
	       
		if (modificationDate.compareTo(creationDate) < 0) {
			throw new IllegalArgumentException("modificationDate");
		}
		this.creationDate3 = creationDate;
		// do a bunch of date calculations. 
		// this.creationDate3 = modificationDate;  // <= compiler error
	
public FinalMembers(Date modificationDate)
Second constructor. Use current date for creation date.

param
modificationDate The last modification date.

		this.modificationDate = modificationDate;
		// <= compiler error: