Computer Science, asked by asthanasri1535, 10 months ago

What is constructor? State any two characteristics.​

Attachments:

Answers

Answered by rakzhana01
1

Answer:

In class-based object-oriented programming, a constructor (abbreviation: ctor) is a special type of subroutine called to create an object. It prepares the new object for use, often accepting arguments that the constructor uses to set required member variables. ... Immutable objects must be initialized in a constructor.

Answered by sreenidhijan2007
2

Answer:

Characteristics of constructor. They should be declared in the public section. They are invoked automatically when the objects are created. They do not have return (data type) type not even void and there for they cannot return any values.

Similar questions