Skip to content
Related Articles

Related Articles

Improve Article

ISRO | ISRO CS 2013 | Question 74

  • Last Updated : 15 May, 2018

What is the right way to declare a copy constructor of a class if the name of the class is MyClass?
(A) MyClass (constant MyClass *arg)
(B) MyClass (constant MyClass &arg)
(C) MyClass (MyClass arg)
(D) MyClass (MyClass *arg)

Answer: (B)

Explanation: In this question, language is not specified so there can be multiple options correct.
MyClass (constant MyClass &arg) // copy constructor in C++
MyClass (MyClass arg) // copy constructor in Java

Refer: 1) Copy Constructor in C++
2)Copy Constructor in Java

Quiz of this Question

My Personal Notes arrow_drop_up
Recommended Articles
Page :