Can we have "Virtual Constructors"?

Answer Posted / shashank agrawal

No, This is not possible because virtual is used for avoid
overriding and the constructor is called when the object of
that class has been created so in this case overriding is
not possible then to make the constructor as virtual is
useless.so we dont create it virtal.

Is This Answer Correct ?    13 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is microsoft c++ redistributable?

699


What is the insertion operator and what does it do?

653


What are formatting flags in ios class?

696


Is c better than c++?

741


which operator is used for performing an exponential operation a) > b) ^ c) none

696






A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.

1821


What apps are written in c++?

701


Should the this pointer can be used in the constructor?

641


Is c++ free?

699


What are the 4 types of library?

703


What is different in C++, compare with unix?

698


Explain what data encapsulation is in c++?

657


Which software is used to run c++ program?

622


What is the difference between method overloading and method overriding in c++?

646


Why do we use the using declaration?

772