8. วัตถุสิ่งของ

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.

 
รหัสที่ 8-33  ตัวสร้างสำเนาของคลาส Point
public class Point {
  private int x, y;
  public Point(Point p) {
    this.x = p.x;
    this.y = p.y;
  }
  public void setXY(int x, int y) {
    this.x = x; this.y = y;
  }
  public int getX() {
    return x;
  }   
  ...
©2009 S.Prasitjutrakul