ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage   interview questions urls   External Links  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C++  >>  C++ General
 
 


 

 
 STL interview questions  STL Interview Questions
 OOPS interview questions  OOPS Interview Questions
 C++ General interview questions  C++ General Interview Questions
Question
Can we declare destructor as static? Explain?
 Question Submitted By :: Guest
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Can we declare destructor as static? Explain?
Answer
# 1
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 ?    2 Yes 0 No
Murali
 
  Re: Can we declare destructor as static? Explain?
Answer
# 2
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 ?    1 Yes 0 No
Jaroosh
 
 
 

 
 
 
Other C++ General Interview Questions
 
  Question Asked @ Answers
 
this is to swap to strings....but in output the whole strings are swapped leaving first as it is...why it is so #include<iostream.h> int main() { char a[]="ajeet"; char b[]="singh"; long x=*a; long y=*b; cout<<x<<":"<<y; x=x+y; y=x-y; x=x-y; *a=x; *b=y; cout<<x<<":"<<y; cout<<&a<<endl; cout<<&b<<endl; }  1
What are the different operators in C++? HP1
What is conversion constructor? TCS1
How do you test your code? Microsoft3
Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); a) 10 b) 11 c) 1 Quark1
How is an Abstract Base Class(ABC) related to an "Abstract Data Type" (ADT)  2
What are the different types of Storage classes?  3
Write any small program that will compile in "C" but not in "C++" Honeywell6
What C++ libraries are you proficient with? Google1
What is a mutex and a critical section.Whats difference between them?How do each of them work? CTS1
Which uses less memory? a) struct astruct { int x; float y; int v; }; b) union aunion { int x; float v; }; c) char array[10]; Quark3
What is the Difference between "C structure" and "C++ structure"?  3
What is the difference between Class and Structure? HP2
What are advantages and disadvantages of Design patterns? IBM2
What are Binay tress and B trees? Diff between them? CTS1
string somestring ; Which of the following choices will convert a standard C++ string object "somestring" to a C string? a) Copy.somestring () ; b) somestring.c_str () c) &somestring [1] d) std::cstring (somestring) e) (char *) somestring Quark1
Can we use resume in error handling i.e. in the catch block Infosys3
Is there any difference between dlearations int* x and int *x? If so tell me the difference? Lason13
class Foo { public: Foo(int i) { } }; class Bar : virtual Foo { public: Bar() { } }; Bar b; Referring to the above code, when the object 'b' is defined, a compiler error will occur. What action fixes the compiler error? a) Adding a virtual destructor to the class Bar b) Adding a constructor to Bar which takes an int parameter c) Adding "Foo()" to the Bar constructor d) Adding a copy constructor to the class Foo e) Adding "Foo(0)" to the Bar::Bar initializer list Quark1
Which one of the following describes characteristics of "protected" inheritance? a) The base class has access only to the public or protected members of the derived class. b) The derived class has non-public, inheritable, access to all but the private members of the base class. c) The derived class has access to all members of the base class. d) The private members of the base class are visible within the derived class. e) Public members of the derived class are privately accessible from the base class. Quark3
 
For more C++ General Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com