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

Hellpppp anyyonee???!!!
PLZ SOMEONE HELP ME WITH THIS!! in the triangle, the length of side a is 5ft and m < A = 60°. Find the exact lengths of sides b and c.
What explains the popularity of the ghost dance movement in the 1880s?
This problem is realy tricky. Ive tried numerous ways. Can I get help?
Anoche Carlos y Erica que estudiar mucho
Marion is creating an adaptation of this poem. She is considering theatrical lighting, sound effects, and scenic design. What area would this involve?
Larry’s evening is spent reading and watching TV. he can spend no more than 4 hours total on there activities, and wants to spend more time reading than watchin
How does the five pillars of Islam influence the daily lives of Muslims?
Explain how the Agricultural Adjustment Act and the Rural Electrification Act impacted farmers.
Which set of measurements could be the side lengths of a triangle? A)3 m, 6 m, 3 m B)9 m, 5 m, 3 m C)4 m, 7 m, 12 m D)4 m, 11 m, 9 m