/**
 * Represents a Farm (poorly).  
 * Primarly used to demonstrate pass by value for object variables
 * @author CSCI209
 */
public class Farm {

    private String name;

    public Farm(String name) {
        this.name = name;
    }

    /**
     * c copies the value of the variable passed into the method
     * so the Chicken object that is referenced by c will be
     * changed after this method returns.
     */
    public void feedChicken(Chicken c) {
        c.setWeight( c.getWeight() + .5 );
    }

    public static void main(String[] args) {
        Farm farm = new Farm("OldMac");
        Chicken sal = new Chicken("Sallie Mae", 45, 5.0);
        System.out.println(sal.getWeight());
        farm.feedChicken(sal);
        // weight of Sal will be higher.
        System.out.println(sal.getWeight());
    }

}