Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What are mutator methods in c++?

1162


What is command line arguments in C++? What are its uses? Where we have to use this?

1272


What are guid? Why does com need guids?

1051


Draw a flow chart and write a program for the difference between the sum of elements with odd and even numbers. Two dimensional array.

6403


What is operator overloading in c++ example?

1136


Does c++ have string data type?

1106


What is flush () in c++?

1079


Write about the local class and mention its use?

1071


What is a tree in c++?

970


What are abstract data types in c++?

980


When we use Abstract Class and when we use Interface?where we will implement in real time?

2179


What is virtual methods?

1119


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?

1077


What is conditions when using boolean operators?

1224


What are the extraction and insertion operators in c++?

1000