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

Y= Mx+B. Solve for M
Sabrina calculates the cost of a book as $50. The actual price was $56. What is Sabrina's percent error.
How do I write one hundred and twenty five thousandths in decimal form?
2. Directions: Select the correct text in the passage.Which sentence in the passage uses setting to help reveal characterization? Waiting John had strict
What does the reader need to know, so that they understand what you’re writing about and want to read more?
the cooks only have 23,572 blueberries for the pancake breakfast. If they plan on having about 837 people, about how many blueberries will each person get?
use decimals. write 3 numbers between 0.8 meter and 0.9 meter
What is the difference between 7/8 and 1/2
What important change happened during Andrew Jackson's presidency
What is the literary term for the character who is the “opponent” or the “bad guy”? a. protagonist b. stock character c. antagonist d. archetype