Java class called Rectangle with the following attributes and methods:
• Attributes: length and width (both double).
• Methods:
1. A constructor to initialize the attributes.
2. A method getArea() to calculate and return the area of the rectangle.
3. A method getPerimeter() to calculate and return the perimeter of the
rectangle.