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.

Answers were Sorted based on User's Feedback



Describe ways of cleaning up objects...

Answer / anky

using the keyword Dispose, we can delete the objects!

Is This Answer Correct ?    11 Yes 1 No

Describe ways of cleaning up objects...

Answer / sugumar.r

Actually, there are two ways resources can be cleaned up
from our application.( Garbage Collection)
1. Dispose()- By default system will release all non
referenced variables from memeory.
2.Finalize()- We can explicitly perform Cleaning process
using Finalize method(Destructor)

Is This Answer Correct ?    8 Yes 1 No

Describe ways of cleaning up objects...

Answer / vaidyanathan

By Dispose() method the object is marked for garbage
collection. But user can define a Dispose() method
identified by GC, only when the user implements the
IDisposable interface in the class. Once the dispose()
marks the object for deletion, the garbage collector, in
its subsequent collection cycle, collects the objects by
calling the respective Finalize() methods. So there is no
need for the user to write the Finalize() method. This is
the normal Process of Garbage collection.

At extreme cases user can force the garbage collection at a
specific time by calling GC.Collect() method. This should
be followed by GC.SuppressFinalize() method call to avoid
GC from calling Finalize() method on the same object once
again.

Is This Answer Correct ?    5 Yes 0 No

Describe ways of cleaning up objects...

Answer / ben

In java automatic garbage collection is erformed.

Is This Answer Correct ?    4 Yes 0 No

Describe ways of cleaning up objects...

Answer / subramanyam

in dotnet garbage collector automatically deletes the
object that is no more referenced

Is This Answer Correct ?    5 Yes 2 No

Describe ways of cleaning up objects...

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

Describe ways of cleaning up objects...

Answer / mr. d

Using Dispose() method releases all the resources and memory
occupied by that object.

Is This Answer Correct ?    1 Yes 0 No

Describe ways of cleaning up objects...

Answer / ashok

using the keyword NOTHING we can destroy the objects.

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More C Sharp Interview Questions

Write code for palindrome?

10 Answers   Tech Mahindra,


Explain what a diffgram, and a good use for one Define diffgram? How it be used?

0 Answers   Siebel,


Which operator cannot be overloaded in c sharp?

0 Answers  


What is a three-tier application.

0 Answers   Siebel,


Why we put script in head of asp.net page Why not in body?

1 Answers  


Can you access a hidden base class method in the derived class?

0 Answers  


Explain what is the smallest unit of execution in .net?

0 Answers  


What is a generic method?

0 Answers  


Why do we need indexers in c#?

0 Answers  


How objects are stored in memory?

0 Answers  


how many catch we can write in thye program?

2 Answers  


What does mean c#?

0 Answers  


Categories