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


what is use to destroy an object? illustrate.

Answers were Sorted based on User's Feedback



what is use to destroy an object? illustrate...

Answer / rakhi

Object is distroyed when it goes out of the scope and it
can be distroy with its default destructor.

Is This Answer Correct ?    18 Yes 0 No

what is use to destroy an object? illustrate...

Answer / sujatha

object can be destroyed by using DESTRUCTORS

EX:

class A
{

int p;
public:
A(int x)
{
x=p;
cout<<"constructor is called memory is allocated to
variable x\n";

}
void show()
{
cout<<"x="<<x;
}

~A()
{

cout<<"destructor called and deaalocte memory occupied by
x\n";

}
};

void main()
{
A a1(10);
a1.show();
}

output

constructor called memory is allocated to variable x

x=10
destructor called and deaalocte memory occupied by x

Is This Answer Correct ?    9 Yes 0 No

what is use to destroy an object? illustrate...

Answer / sweety

An object is destroyed to make memory available for further
use by any other object. and this can bo done by using
destructors.

Is This Answer Correct ?    5 Yes 0 No

what is use to destroy an object? illustrate...

Answer / safe

an object is destroyed to make memory free which is
allocated by object. it can automatically done by destructor
(default destructor)if we dont call a destructor.

Is This Answer Correct ?    4 Yes 1 No

what is use to destroy an object? illustrate...

Answer / sumeet sharma

Simple a destructor function is used for it.
it takes the resources acquired by the object.
it is called when the object goes "out of scope"

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More OOPS Interview Questions

explain defference between structure and class with example

2 Answers  


What are the benefits of oop?

0 Answers  


write string class as your own class in java without using any built-in function

0 Answers  


When is an object created and what is its lifetime?

4 Answers   IBM,


Give two or more real cenario of virtual function and vertual object

0 Answers   TCS,


Why do pointers exist?

0 Answers  


some one give d clear explanation for polymorphism

3 Answers  


define oops with class and object

5 Answers   HCL, Tech Mahindra,


Have you ever interfaced with a database?

2 Answers   IBM,


what is difference between objects and function

3 Answers  


Why we are use # in begning of programme of c++.

2 Answers   Syntel,


How is data security provided in Object Oriented languages? ?

5 Answers  


Categories