C++ Programming - OOPS Concepts - Discussion

Discussion Forum : OOPS Concepts - General Questions (Q.No. 42)
42.
In which of the following a virtual call is resolved at the time of compilation?
From inside the destructor.
From inside the constructor.
From inside the main().
Both A and B.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
14 comments Page 2 of 2.

Anil said:   1 decade ago
To construct an object, a constructor needs the exact type of the object it is to create. That means compiler has to know the type of object before the creation, that is only possible at compile time.

Similarly we cannot create classes having same name i.e., each class name is unique. Constructor and destructor name is similar to classname.

Mohit said:   1 decade ago
To construct an object, a constructor needs the exact type of the object it is to create. That means compiler has to know the type of object before the creation, that is only possible at compile time.

Similarly we cannot create classes having same name i. e, each class name is unique. Constructor and destructor name is similar to classname.

Ravindra bagale said:   1 decade ago
@Shilpa.

To construct an object, a constructor needs the exact type of the object it is to create. That means compiler has to know the type of object before the creation, that is only possible at compile time.

Shilpa said:   1 decade ago
Please explain why?


Post your comments here:

Your comments will be displayed after verification.