Computer Science, asked by kpatel27, 3 months ago

what is constructor and it's type ​

Answers

Answered by Anonymous
1

Answer:

A constructor is a special type of function with no return type. ... We define a method inside the class and constructor is also defined inside a class. A constructor is called automatically when we create an object of a class. We can't call a constructor explicitly. Let us see the types of constructor.

Answered by srijabhowmik
2

Answer:

constructor is a special type of function with no return type. Name of constructor should be same as the name of the class. We define a method inside the class and constructor is also defined inside a class. A constructor is called automatically when we create an object of a class. We can’t call a constructor explicitly. Let us see the types of constructor.

Constructor Types

Default Constructor

Parameterized Constructor

Copy Constructor

Static Constructor

Private Constructor

Similar questions