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

|-4 + x| -12 What is the value of expression on X = 6? A -2 B -10 C 2 D 10
What is the role of the Strategic National Stockpile in flu pandemic preparedness? A. It helps state and local governments plan for flu pandemic response. B. I
“The bet” by Anton theme
What a th lowest value of the range of the function shown on the graph
List two reasons Andrew Carnegie’s workers/laborers would want to go on strike.
How do ranges of tolerance affect the distribution of organisms?
what is a faster way to do long division? examples would be greatly appreciated
What is the main difference between a chemical and a physical change?
Because egypt received little rainfall, agriculture in the kingdom depended on irrigation supplied by? (A)water from the red sea (b)water transported by slaves
Helppppppp please, thanks!!