public class TestRefParams { public static void main( String [] args ) { IntClass myInt = new IntClass(); myInt.set( 15 ); System.out.println("before: " + myInt.get() ); increment( myInt ); System.out.println("after: " + myInt.get() ); } public static void increment( IntClass ref2IntClass) { int contents = ref2IntClass.get(); ++contents; ref2IntClass.set( contents ); System.out.println("During: " + ref2IntClass.get()); } }