C# Interview Questions!!

class ObjectA
{
private int val;
public ObjectA(int i)
{
val = i;
}
}

struct ObjectB
{
private int val;
public ObjectB(int i)
{
val = i;
}
}

static void Main(string[] args)
{

ObjectA obj1 = new ObjectA(10);
ObjectA obj2 = new ObjectA(10);

ObjectB str1 = new ObjectB(10);
ObjectB str2 = new ObjectB(10);

Console.WriteLine(obj1.Equals(obj2));
Console.WriteLine(str1.Equals(str2));
Console.ReadLine();
}
}

OutPut:
False
True

Comments

Popular posts from this blog

Windows Azure Package Build Error: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

Resource ID : 1. The request limit for the database is 180 and has been reached.

How to get Client's Location using IPAddress