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 is string class in c#?
Major difference between Basic httpbinding and WShttpbinding?
Why do we use Design Pattern in C#?
What is the Signification of the "new " keyword in C#? example
What is the difference between static and private constructor?
How jit (just in time) works?
What is collection class c#?
Could you explain the difference between func vs action vs predicate?
C# called c sharp why?
What are functions c#?
What is get set in c#?
What is task parallel library?
What does this keyword mean in c#?
What is use of console?
How many digits is a 32 bit number?