Multiple choice technology programming languages

Which of the following can be used to initialize a newly declared Variable from an existing variable?

  1. Virtual Function

  2. Namespaces

  3. copy constructor

  4. None of the Above

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

A copy constructor is a special constructor that initializes a new object as a copy of an existing object of the same class. It takes a reference to an object of the same class as its parameter and creates a new object with identical values. Virtual functions and namespaces are unrelated to variable initialization.