aliensbrain
  • Home
  • Study
  • Quizzes
  • 🎤AI Practicefree
  • Notebooks
  • Community
  • Sign in
  • C Programming Fundamentals
  • If class name is Y, which is the right code to declare th...
Multiple choice

If class name is Y, which is the right code to declare the copy constructor of the class?

  1. Y(const Y & arg )

  2. Y(Const *Y arg )

  3. Y(Y arg)

  4. Y(Y & arg)

  5. None of these

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

Copy constructor takes const as reference to the class type to the argument .

Keep practicing — related questions

  • If X is the name of the class, what is the correct way to declare copy constructor of X?
  • int he below code, which declaration hold for copy constructor? class C{ int x; public: C(int t);//-----> (...
  • Which of the following variables can be used as an argument to copy constructor?
  • Which of the following is not calling the copy constructor of class given below? Class Test { public: Test(...
  • A constructor's name is same as __________
  • If a class is defined with the name 'A', then what will be the valid declaration(s) for the constructor of ...
  • Which of the following is correct code to define a contructor in ActionScript class?
  • Can a copy constructor accept an object of the same class as parameter, instead of reference of the object?
Play the full quiz 🎤 Practise this topic out loud

Practice this topic

  • Object-Oriented Programming (2239 questions)
Advertisement
© Aliensbrain | all rights reserved
  • About
  • Contact
  • Terms and Condition
  • Privacy Policy