Implement a class Rectangle.
Implement a class Square that extends Rectangle.
class Rectangle
{
private int a, b; // private variable
Rectangle(int a, int b) // Constructor
public int Area() // return area
public int Perimeter() // return perimeter
}
class Square extends Rectangle
{
Square(int a) // Constructor
}Each line contains one of two figures in the next format:
Rectangle a b
Square a
Here and are sides of rectangle. In the case of a square is its side.
For each figure print in one line its area and perimeter.
Example 1