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-11  การเพิ่มตัวสร้างปริยายให้กับคลาสที่ไม่เขียนตัวสร้างใด ๆ เลย
public class Ball {
  public double x, y;
  public double dx, dy;
  public double r;
}

public class Ball { public double x, y; public double dx, dy; public double r; public Ball() { //ตัวสร้างปริยาย  } }
©2009 S.Prasitjutrakul