import java.awt.Rectangle;

public class RectangleMain {
  public static void main(String[] args) {
    // the variable a can store an integer
    int a;
    // the variable b can store numbers 
    // with fractional parts
    double b;
    // the variable r can store a reference
    // to a Rectangle object
    Rectangle r;
    a = 42;
    b = 3.14;
    // construct an object and assign it to r
    r = new Rectangle(5,10,20,30);
    System.out.print("r is ");
    System.out.println(r);
    
    r.setLocation(-7,13);
    System.out.print("r is ");
    System.out.println(r);
    
    r.setSize(40,60);
    System.out.println("r is " + r);
    
    r.translate(10,-5);
    System.out.println("r is " + r);
    
    // another variable for fractional numbers
    double z;
    
    // another variable for Rectangle objects
    Rectangle r2;
    
    // copy b's value to z
    z = b;
    
    // copy r's reference to r2
    r2 = r;
  }
}
