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

Given a simple program designed to take inputs of integers from 1-1000 and to output the factorial value of that number, how would you test this program? You do not have access to the code. Please be as specific as possible.

4 Answers   Microsoft,


Explain data encapsulation?

0 Answers  


What are the comments in c++?

0 Answers  


Explain differences between alloc() and free()?

0 Answers  


What is the use of pointer in c++ with example?

0 Answers  


How do you invoke a base member function from a derived class in which you have not overridden that function?

0 Answers  


Differentiate between realloc() and free().

0 Answers  


Is vector a class in c++?

0 Answers  


What is slicing?

1 Answers  


What is difference between n and endl in c++?

0 Answers  


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

0 Answers  


What are the different types of Storage classes?

5 Answers  


Categories