public class MainClass { public static void main(String args[]) { MyClass h = new MyClass(); h.intValue = 100; h.changeValue(h); System.out.println(h.intValue); } } class MyClass { public int intValue; public void changeValue(MyClass theHolder) { theHolder.intValue++; } }