/*
 * File: ChangingSize.java
 * -----------------------
 * Will changing rect2 in changeSize change rect1?
 * Spoiler: Yes it will!
 */

import java.awt.Color;
import java.awt.event.*;

import acm.graphics.*;
import acm.program.*;

public class ChangingSize extends GraphicsProgram {


	public void run(){	
		int size = 250;
		GRect rect1 = new GRect(size, size);
		GRect rect2 = rect1;
		// Changing rect2 will change rect1 because they refer to the same
		// memory address!
		changeSize(rect2, size);
		add(rect1, 100, 100);
	}

	private void changeSize(GRect rect, double size){
		size += 250;
		rect.setSize(size, size);
	}



}


