package paremeter_transfer; class MyObject { int intValue; String strValue; MyObject(int i,String s) { intValue=i; strValue=s; } void show() { System.out.println("intvalue="+intValue); System.out.println("strValue="+strValue); } } public class TestDemo { static void changPrimitiveValue(int i) { System.out.println("in changPrimitiveValue() " +"before change: i="+i); i=100; System.out.println("in changPrimitiveValue()" +"after change: i="+i); } static void changeReferenceValue(MyObject obj) { System.out.println("in changeReferenceValue() before change"); obj.show(); obj.intValue=100; obj.strValue="a New String."; System.out.println("in changeReferenceValue() after change"); obj.show(); } public static void main(String[] args) { MyObject obj=new MyObject(1,"Fan"); obj.show(); changeReferenceValue(obj); obj.show(); } }