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

Write an expression having only two terms that is equivalent to 2x – 3. Explain how you wrote the expression and how you can check that it is equivalent. QUICKL
A computer and printer cost of $1053 the cost of the computers is two times the cost of the printer. Find the cost of each item
Which element is shared by "The Perfect Tribute" and the Gettysburg Address?
 If 7.40 g of O3 reacts with 0.670 g of NO, how many grams of NO3 will be produced? Identify the limiting reagent from the reaction. 2O3 + 3NO → 3NO3 O2 produ
Which of the following did the FEDERALISTS favor? A. A Bill of Rights B. A single president C. a weak federal government
Which of the following is an example of instinct?
A 6-foot piece of copper wire costs $18.00. What is the price per inch?
The perimeter of a square is 24 m. find it's area ​
Which molecules are needed by the plant for photosynthesis to occur? Select all the apply. Water Oxygen Glucose Carbon dioxide
I would really like help :)