CS232 Spring 2008 public class Rect { static int z = 5; int x, y, width, height; public Rect(int x, int y, int width, int height) { this.x = x; this.y = y; this.width = width; this.height = height; } public int getW() { return this.width; } public boolean isColored() { return false; } } public class ColorRect extends Rect { Color color; public ColorRect(int x, int y, int width, int height, Color c) { super(x, y, width, height); this.color = c; } public Color getC() { return this.color; } public boolean isColored() { return true; } } public class Main { public static void main(String[] args) { Rect r = new Rect(1,2,3,4); ColorRect s = new ColorRect(5,6,7,8,Color.red); int x = r.getW(); int y = s.getW(); Color c = s.getC(); boolean b1 = r.isColored(); boolean b2 = s.isColored(); r.z = 6; s.z = 7; } }