public class Demo {
  public static void main(String[] args) {
    Date d = new Date(3, 11, 2553);
    Date d1 = new Date(d);
    System.out.println(d.day);
    System.out.println(d.month);
    System.out.println(d.year);       
/*    
    Polygon pg = new Polygon();
    pg.p = new Point[5];
    pg.p[0] = new Point();
    pg.p[0].x = 10; pg.p[0].y = 20;
    pg.p[1] = new Point();
    pg.p[1].x = 10; pg.p[1].y = 50;
    pg.p[2] = new Point();
    pg.p[2].x = 60; pg.p[2].y = 90;
    pg.p[3] = new Point();
    pg.p[3].x = 10; pg.p[3].y = 120;
    pg.p[4] = new Point();
    pg.p[4].x = 30; pg.p[4].y = 40;
    
    Polygon.draw(pg);
    */
  }
}
//-----------------------------------------------------------------------
public class Ball {
  public double x, y;
  public double dx;
  public double dy;
  public double r;
  
  // ถ้าเราไม่เขียน constructor เลย, compiler จะเติม default constructor
  public Ball() {
  }
}
//------------------------------------------------------------------------
public class Point {
  public double x, y;
  
  public Point(double x1, double y1) {
    x = x1; y = y1;
  }  
  public Point(Point p) { // copy constructor
    x = p.x;
    y = p.y;
  } 
}
//-------------------------------------------------------------------------
public class Date {
  public int day, month, year;
  
  // constructor: name = class name, no static, no return-type
  public Date(int d, int m, int y) {
    day = d;
    month = m;
    year = y;
  }
  public Date() {
  }
  // copy constructor
  public Date(Date d) {
    // ตั้งค่าเริ่มต้นของ data members ให้เหมือนกับอ็อบเจกต์ที่รับมา
    day = d.day;
    month = d.month;
    year = d.year;
  }

}
//---------------------------------------------------------------------------
public class BankAccount {
 public String id = "";
 public double balance = 0;
 public BankAccount(String newID, double iniBalance) {
   id = newID;
   balance = iniBalance;
 }
 public static void deposit(BankAccount b, double amt) {
   if (amt > 0) b.balance = b.balance + amt;
 }
 public static void withdraw(BankAccount b, double amt) {
   if (amt > 0 && amt <= b.balance)
     b.balance = b.balance - amt;
 }
 public static void transfer(BankAccount from,
                             BankAccount to, double amt) {
 }
 public static double totalAmount(BankAccount[] acc) {
   
 }
 public static String getMaxBalanceAccount(BankAccount[] acc) {

 }
}
