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

the perimeter of the rectangle below is 104 units. Find the length of side RS. write your answer without variables
describe differences in water and oil. use the following terms in your description in the correct context : polar, nonpolar, hydrophilic, and hydrophobic​
What is an equation of the line that passes through the points (-6,-3) and (-3,-5) ?​
PLEASE HELP WILL AWARD BRAINLIEST
What were the terms of the armistice with France?
What is 3 things about cell theory?
What is 5 x 9 the answer
Believed if a government acts against the will of the people,the social contract has been broken and the government should be dissolved? -Thomas Hobbes -Baron d
layla is a friend of yours who constantly cuts you off to talk about a similar problem she has ignoring your feelings. which communication roadblock does she de
Type an equation for the line shown in the graph. (0, 2) y= [?] + [ ] ​