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

you are given an orange liquid. what methos would you use to observe and describe the physcial properties of the liquid without changing it?
If you travel at a rate of 45 miles per hour.How many minutes will it take to travel 1 mile
how to work out [ (6³-9)÷23] 4
What number is 10 more than 8,358
Without parentheses the expression 8 plus 30 divided by 2 plus 4 equal 27. Rewrite the expression with parentheses so it equals 13; then 23
is a rectangle a parallelogram yes or no explain your answer
The cover of a photo album has an area of 97.5 square inches. Find it's area in square centimeters. (1 cm = 0.39 in)
what are two organs that are difficult to repair using stem cells?
You travel 60 kilometers in 1.5 hours. What is your average speed?
how do you write 6,007,200 in two other forms