Sunday, 22 August 2010

to declare object

//source code to declare object
using System;
namespace OOPSProj
{
class First
{
int x = 100;
static void Main()
{
First f11 = new First();
First f22 = f11;
f11 = null;
Console.WriteLine(f22.x); //Valid
Console.WriteLine(f12.x); //InValid
Console.ReadLine();
}
}
}

No comments:

Post a Comment