Computer Science, asked by victoria623, 9 months ago

Define a class called rectangle to have the following class members.
Private:
•Two sides(float)
Private:
•A parameterized constructor to initialize the two sides
•A copy constructor to copy the two sides of the rectangle to a new rectangle
•Function Area() to calculate area of rectangle
•Function ShowArea() to show the area as well as the two sides value

Write the main function and show dynamic initialization also?

Answers

Answered by aryanshinde0901
1

Answer:

I don't know about it sorry

Answered by HarryNakum
0

Answer:

As you know, a class provides the blueprint for objects ; you create an object from a class. Each of the following statements taken from the CreateObjectDemo program creates an object and assigns it to a variable

Declaration: The code set in bold are all variable declarations that associate a variable name with an object type.

Instantiation: The new keyword is a Java operator that creates the object. As discussed below, this is also known as instantiating a class.

Initialization: The new operator is followed by a call to a constructor. For example, Point(23, 94) is a call to Point's only constructor. The constructor initializes the new object.

Explanation:

plz mark as brainliest answer

Similar questions