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-34  คลาส Circle ที่ใช้อ็อบเจกต์ของ Point เก็บจุดศูนย์กลาง
public class Circle {
  private Point center;
  private int radius;
  public Circle(Point c, int r) {
    center = c;  radius = r;
  }
  public Point getCenter() {
    return center;
  }
©2009 S.Prasitjutrakul