FileDocCategorySizeDatePackage
RefValues.javaAPI DocExample886Sat Nov 25 12:54:18 GMT 2000None

RefValues

public class RefValues extends Object
RefValues - program to show Reference values vs scalars.

Fields Summary
Constructors Summary
public RefValues()

		long longValue = 420;
		GregorianCalendar d1 = new GregorianCalendar(1971,04,24);

		System.out.println("Before demoMethod, long = " + longValue + 
			" Year = " + d1.get(Calendar.YEAR));

		demoMethod(longValue, d1);

		System.out.println("After  demoMethod, long = " + longValue + 
			" Year = " + d1.get(Calendar.YEAR));
		if (d1 == null) {	/* "can't happen" */
			System.err.println("demoMethod changed my date obj!");
			return;
		}
	
Methods Summary
public voiddemoMethod(long myLong, java.util.GregorianCalendar myCal)

		myLong = 24;		// does not affect main.longValue
		myCal.set(Calendar.YEAR, 1999);  // DOES affect main's d1
		myCal = null;		// no affect on main's d1
	
public static voidmain(java.lang.String[] argv)

		RefValues ref = new RefValues();