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

Most of the revolutions for independence in South America occurred between A. 1780-1810. B. 1800-1830. C. 1820-1840. D. 1860-1880.
looking at entrepreneurship as an alternative career path venture, discuss the role of family members in assisting in the process of making informed decisions a
why is cell division useful even in an adult who isn't even growing
why do people think recycling is bad
¿cual fue el contexto geografico de la revolucion industrial?
What is the sum of 5+2 or 2+5? Why is the sum the same?
While Karl Marx viewed social class as the influential factor for other inequalities in a capitalist society, Max Weber also included status and _______ as affe
what statement is true about regular exercise?
Alexander is riding his bicycle to school. After one mile, he is a third of the way there. How much farther does he have to ride? is it 2
Despite continued efforts for peace in the Arab-Israeli conflict, why was there a continuing struggle in the occupied territories?