1 /* 2 * File: Square.java 3 * 4 * Square class 5 * 6 * Copyright: Northeast Parallel Architectures Center 7 * 8 */ 9 10 // A square is a rectangle with equal sides: 11 public class Square extends Rectangle { 12 13 // Square constructor #1: 14 public Square( int x, int y, int size ) { 15 16 // invoke a constructor of the superclass: 17 super( x, y, size, size ); 18 19 } 20 21 // Square constructor #2: 22 public Square( int x, int y, int size, double theta ) { 23 24 // invoke a constructor of the superclass: 25 super( x, y, size, size, theta ); 26 27 } 28 29 // Square constructor #3: 30 // public Square( int x, int y, int r ); // a conflict! 31 32 }