danteF9827 danteF9827
  • 21-08-2019
  • Computers and Technology
contestada

What is a constructor? Why would you include a constructor in a class?

Respuesta :

Cetacea
Cetacea Cetacea
  • 26-08-2019

Answer:

Constructor in the class is the member function that gets into action when any new object gets created in the class ,it gets invoked. It does not have any return type and no void return.

The constructor is used in the class because there is the requirement for the initializing of the new object and then only object can do the functioning in the program.

Answer Link

Otras preguntas

F(9) if f (x)=5x-16, what is the answer to the math problem
Let’s say you had to write a constitution to live by. What would your own personal constitution say? In other words if you had to put your own personal values i
___ are the reproductive organs that produce gametes
a jeweler buys a ring from jewelry maker for $125. he marks up the price by 135% for sale in his store. what is the selling price of the ring with 7.5% sales ta
Why was the British public angry about the Battles of Lexington and Concord? Select the best answer from the choices provided. They believed British troops s
5 cents per mile if I drive 1000
Exercise 9 please !!!
I wasn't in school for this lesson. Can someone please help with the circled ones?
A recipe for cake needs 3/4 if a cup of milk. you are making 1/2 of the recipe.his much milk do you need
Using the numbers 2,5,8, and 9 create a equation that equals 4