6. แยกย่อย

The Camtasia Studio video content presented here requires JavaScript to be enabled and the latest version of the Macromedia Flash Player. If you are you using a browser with JavaScript disabled please enable it now. Otherwise, please update your version of the free Flash Player by downloading here.

 
รหัสที่ 6-5  ตัวอย่างแสดงการเปลี่ยนค่าของพารามิเตอร์ในเมท็อดไม่มีผลต่อตัวแปรของผู้เรียก
int a = 23, x = 36;
reset(a);
reset(x);
System.out.println(a + ", " + x); // แสดง 23, 36

public static void reset(double x) { x = 0; }
©2009 S.Prasitjutrakul