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

Discuss the possibilities related to the termination of a program before entering the mainq method?

1000


What is while loops?

1098


Using a smart pointer can we iterate through a container?

1137


What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

1149


What do you mean by function overriding & function overloading in c++?

1263


What is wrapper class in c++?

1195


Is swift a good first language?

1086


Explain the difference between abstract class and interface in c++?

1034


What is the best way to declare and define global variables?

1410


What is an overflow error?

1152


Which bit wise operator is suitable for turning off a particular bit in a number?

1162


Define what is constructor?

1113


What is ostream in c++?

1064


What do you mean by delegate? Can a user retain delegates?

994


What is the use of string in c++?

1072