FileDocCategorySizeDatePackage
FinalArgs.javaAPI DocExample445Sun Dec 27 15:20:34 GMT 1998None

FinalArgs.java

import java.util.*;

/**
 * Experiment with "final" args to functions (new in 1.1)
 */
public class FinalArgs {
	public static void main(String argv[]) {
		new FinalArgs().run();
	}
	void run() {
		System.out.println("Hummm de dummm...");
		myFunc(new Date());
		System.out.println("Once upon a time...");
	}
	void myFunc(final Date d) {
		// d = null;	// this will not compile
		d.setYear(99);	// this will compile, and changes the object
	}
}