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

if a base class has a number of overloaded constructors, and an inheriting class has a number of overloaded constructors; can you enforce a call from an inherited constructor to a specific base constructor?

1136


What does the keyword “virtual” declare for a method or property?

1009


Can a struct inherit from another struct or class in c#?

960


What is an argument in c#?

1007


What can I create with c#?

974


What is thread safe in c#?

950


Why do we need singleton pattern in c#?

1024


Explain the difference between proc. Sent by val and by sub?

971


Contrast between an interface and abstract class?

1036


what is collections in .net? why we use?

2197


Define multicast c# delegate?

1016


What are the various components in crystal reports?

1004


What is delegates and events?

995


Is arraylist type safe in c#?

1055


What are the features of c#?

983