adspace
What are the restrictions apply to constructors and destructors?
Answer Posted / Ram Prakash Pandey
Constructors cannot be declared static, virtual, or inline. They cannot return a value (except for the conversion constructor). Constructors cannot be overloaded on the basis of return type, but they can be overloaded based on parameters. Destructors must have the same name as the class and should not have any parameters or return a value.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers