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

Describe ways of cleaning up objects.

Answer Posted / vinay tiwari

//we can perform this job with the help of destructor
using System;
class a
{
public int x;
public a(int b)
{
x=b;
}
public void display()
{
Console.WriteLine(x);
}
~a()
{
Console.Write("destroying object which is
created by a()");
}
}
class b
{
static void Main(string [] args)
{
a ob =new a(5);
ob.display();
}
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql transaction in c#?

903


What are async and await?

956


What is difference between a type and class?

1190


What are strings in c#?

947


What is command object in c#?

963


What is the difference between writeline and write in c#?

874


Difference between abstract classes and interfaces

1009


Can we override constructor in c#?

928


How to add a readonly property in c#.net

947


If a class derives from another class, will the derived class automatically contain all the public, protected, and internal members of the base class?

980


What is lazy t?

961


What is strongly typed view?

894


What is data annotation in c#?

949


Which config file has all the supported channels/protocol?

1000


Why do I get a security exception when I try to run my c# app?

1017