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.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What polymorphism means?

1090


What is overriding in oops?

1122


Where is pseudocode used?

1118


Get me an image implementation program.

1998


What is polymorphism programming?

1141


What is abstract class in oop?

1024


What is overloading in oops?

1176


What is inheritance in oop?

1048


Can we have inheritance without polymorphism?

1046


Explain virtual inheritance?

1214


What are the 4 main oop principles?

1237


What is the difference between encapsulation and polymorphism?

1126


What is encapsulation with real life example?

1052


hi all..i want to know oops concepts clearly can any1 explain??

2148


Give an example where we have to specifically use C programming language and C++ programming language cannot be used?

1649