Computer Science, asked by OhhGirl, 1 month ago

What is a constructor? ??​

Answers

Answered by Abhinav3583
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.

Answered by Ᏸυէէєɾϝɭყ
3

Answer:

  • A constructor is methods which are used to create an Object of class.

There are two types of constructor

  1. Default
  2. Parameterized constructor.

Similar questions