_________ is used to declare and initialize an object from another object of same class in C++.

This question was previously asked in
HTET PGT Official Computer Science Paper - 2019
View all HTET Papers >
  1. Copy constructor
  2. Default constructor
  3. Overloaded constructor
  4. Non-parametrized constructor

Answer (Detailed Solution Below)

Option 1 : Copy constructor
Free
HTET PGT Official Computer Science Paper - 2019
4.3 K Users
60 Questions 60 Marks 60 Mins

Detailed Solution

Download Solution PDF

A constructor is a member function of a class that initializes objects of a class. In C++, Constructor is automatically called when an object (instance of a class) creates. It is a special member function of the class.

Syntax

class_name(parameter1, parameter2, ...)

{

    / constructor Definition

}

Default Constructor

It is the constructor that doesn’t take any argument. It has no parameters.

Parameterized Constructors

It is possible to pass arguments to constructors. Typically, these arguments help initialize an object when it is created. 

Copy Constructor

A copy constructor is a member function that initializes an object using another object of the same class.

Latest HTET Updates

Last updated on Jun 6, 2025

-> The HTET TGT Applciation Portal will reopen on 1st June 2025 and close on 5th June 2025.

-> HTET Exam Date is out. HTET TGT Exam will be conducted on 26th and 27th July 2025

-> Candidates with a bachelor's degree and B.Ed. or equivalent qualification can apply for this recruitment.

-> The validity duration of certificates pertaining to passing Haryana TET has been extended for a lifetime.

-> Enhance your exam preparation with the HTET Previous Year Papers.

More OOPs concept Questions

Get Free Access Now
Hot Links: yono teen patti teen patti joy 51 bonus teen patti bliss teen patti vip happy teen patti