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...


Can we declare destructor as static? Explain?

Answers were Sorted based on User's Feedback



Can we declare destructor as static? Explain?..

Answer / murali

Yes we can. But you can't use it.

Use new to create the object.
At the same time you can't use delete.

Why can't : As destuctor uses 'this' context and in this
case it can't being static.

Is This Answer Correct ?    8 Yes 2 No

Can we declare destructor as static? Explain?..

Answer / jaroosh

To sum up : you CANT declare destructor as static, as you
CANT declare constructor as static, both are responsible for
destroying and creating OBJECTS while static storage means
that methods/members do not belong to any objects but to the
whole class.

Is This Answer Correct ?    7 Yes 1 No

Can we declare destructor as static? Explain?..

Answer / sunil

declaring destructor and constructor as static is a syntax error

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More C++ General Interview Questions

How to stop conversions among objects?

5 Answers   Symphony,


Which is the best c++ compiler?

0 Answers  


What problem does the namespace feature solve?

1 Answers  


What does the nocreate and noreplace flag ensure when they are used for opening a file?

0 Answers  


Can you please explain the difference between using macro and inline functions?

0 Answers  


Explain the scope resolution operator?

2 Answers  


What is static class data?

0 Answers  


How we can differentiate between a pre and post increment operators during overloading?

0 Answers  


Explain bubble sorting.

0 Answers  


What is prototype for that c string function?

0 Answers  


Explain the advantages of using friend classes.

0 Answers  


What is "mutable" keyword?

2 Answers   Infosys, Teradata,


Categories