Constructors

Question 1
Which of the following is NOT a type of constructor
A
Copy constructor
B
Friend constructor
C
Default constructor
D
Parameterized constructor
Question 1 Explanation: 
Parameterized constructors: Constructors that can take at least one argument are termed as parameterized constructors. When an object is declared in a parameterized constructor, the initial values have to be passed as arguments to the constructor function.
Default constructors: If the programmer does not supply a constructor for an instantiable class, Java/C++ compiler inserts a default constructor into your code on your behalf. This constructor is known as default constructor.
Copy Constructor: Copy constructors define the actions performed by the compiler when copying class objects. A Copy constructor has one formal parameter that is the type of the class (the parameter may be a reference to an object). It is used to create a copy of an existing object of the same class. Even though both classes are the same, it counts as a conversion constructor.
There is 1 question to complete.

Access quiz wise question and answers by becoming as a solutions adda PRO SUBSCRIBER with Ad-Free content

Register Now

If you have registered and made your payment please contact solutionsadda.in@gmail.com to get access