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

How to declaring variables in c++?

1158


How many types of scopes are there in c++?

1113


What is vector pair in c++?

1233


When there is a global variable and local variable with the same name, how will you access the global variable?

1103


Differentiate between a constructor and a method in C++.

1061


Explain what are mutator methods in c++?

1119


what is Loop function? What are different types of Loops?

1233


What are the advantages of early binding?

1075


What is a far pointer? where we use it?

1077


Is c++ map a hash table?

1029


Explain the concept of memory leak?

1115


Can a program run without main function?

1173


Explain the isa and hasa class relationships.

1040


What is the use of string in c++?

1029


Write about the local class and mention its use?

1084