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

2 m³ of soil containing 35% sand was mixed into 6 m³ of soil containing 15% sand. What is the sand content of the mixture?
To subtract two rational expressions that have a common denominator, you simply _____ the numerators.
Is "please have a seat" a complete sentence?
Should spanish colonial settlers accept the new laws of 1542?
Solve 2cos x+2cos 2x=0 on the interval [0,2pi)
THE FIRST INDIAN WOMAN TO BECOME SPEAKER OF A STATE ASSEMBLY IN INDIA
Solve 2cos x+2cos 2x=0 on the interval [0,2pi)
rearrange the following equations into slope intercept form. -3y=2x-6
the circles below is centered at the point (4,3) and has a radius of length 8. Whats its equation?
What is Armistice Day?