Which of the following is not true about constructor? When an object is…

2026

Which of the following is not true about constructor?

  1. When an object is created and initialized at the same time, a copy constructor gets called.

  2. They do not have return types, not even void.

  3. They can be virtual.

  4. They can not be inherited, though a derived class can call the base class constructor.

Answer: C. They can be virtual.In C++, invoking a constructor always requires naming a concrete, specific class to build — for example new Derived() — rather than reaching it indirectly…

  1. A.

    When an object is created and initialized at the same time, a copy constructor gets called.

  2. B.

    They do not have return types, not even void.

  3. C.

    They can be virtual.

  4. D.

    They can not be inherited, though a derived class can call the base class constructor.

Attempted by 107 students.

Show answer & explanation

Correct answer: C

In C++, invoking a constructor always requires naming a concrete, specific class to build — for example new Derived() — rather than reaching it indirectly through a pointer or reference to some already-existing object, the way an ordinary virtual call works. There is no such object to call the constructor through until construction actually happens. Since a constructor call has no existing object to dispatch through in the first place, the C++ grammar for a constructor declaration does not permit the virtual specifier at all.

Checking the four statements against this rule: the claim that constructors “can be virtual” directly contradicts it — no C++ constructor declaration can carry the virtual specifier — so that is the statement that is not true.

  • The copy-constructor claim holds in its intended sense: copy-initialization — declaring and initializing a new object directly from an existing object of the same class in one step, e.g. ClassName obj2 = obj1; — invokes the copy constructor rather than the assignment operator. (Initializing from a value of a different type, or from a temporary the compiler can move from, calls a different constructor instead, but that is outside what this statement describes.)

  • The return-type claim holds without qualification: constructors carry no return type, not even void, since the compiler invokes them only for their initialization side effect.

  • The inheritance claim holds too, and is phrased carefully enough to survive a stricter reading: a derived class does not receive its base class’s constructors as ordinary members, but it can invoke a specific base constructor explicitly from its own initializer list — exactly the exception the statement itself carves out. (Since C++11, a using Base::Base; declaration can additionally bring selected base constructors into the derived class’s overload set — “inheriting constructors” — but this still requires an explicit declaration rather than happening automatically, so it does not contradict the statement as worded.)

So among the four claims, only the assertion that constructors can be virtual fails to hold outright — that is the statement the question is asking for.

Explore the full course: Nta Ugc Net Paper 2

Loading lesson…