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
What are object pooling and connection pooling and difference between them?
Is it good to use var in c#?
What is windows forms in c#?
What is ilist c#?
Why objects are stored in heap in c#?
what is partial assembly reference
What is ado c#?
What types of object can I throw as exceptions?
What is application object in c#?
What is a string c#?
How can I get around scope problems in a try/catch?
2. What happened when BO object has been called?
What does f mean in c#?
What is a Assembly?
If c# destructors are so different to c++ destructors, why did ms use the same syntax?