It is a program where Class Rect is acting like both a square and rectangle

it is an example of constructor overloading.

both option 1 and 2 are correct

none

Answer :(C)

both option 1 and 2 are correct

Description :

It is a program where Class Rect is acting like both a square and rectangle. it is an example of constructor overloading. It is acting like both square and rectangle because to find area of square we have to pass only side and to find the area of a rectangle we have to pass len and breadth. this class is accepting both so it is acting like both.