is throwing exception from a constructor not a good practice ?
Answer Posted / vikas sood
throwing exception from a constructor is not bad at all. It
is actually advised to use exceptions when you fail to
create your object properly due to any reason. In this case
memory will not be allocated for the object and no
destructor will be called.
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What are mutator methods in c++?
What is command line arguments in C++? What are its uses? Where we have to use this?
What are guid? Why does com need guids?
Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.
What is operator overloading in c++ example?
Does c++ have string data type?
What is flush () in c++?
Write about the local class and mention its use?
What is a tree in c++?
What are abstract data types in c++?
When we use Abstract Class and when we use Interface?where we will implement in real time?
What is virtual methods?
We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?
What is conditions when using boolean operators?
What are the extraction and insertion operators in c++?