package cn.edu.bjut.chapter4; public class Square extends Rectangle { public Square(int length) { super(length, length); } public int area() { System.out.println(this.getClass().getName()); return (length * length); } public int perimeter() { System.out.println(this.getClass().getName()); return (length << 2); } }