protected void Page_Load(object sender, EventArgs e)
{
object s1 = “abc”;
object s2 = “abc”;
if (s1 == s2)
{
Response.Write(“value of s1 and s2 are equal”);
}
else if(s1.Equals(s2))
{
Response.Write(“Address of s1 and s2 are equal”);
}
/***************************************************************
* 1.==compares values of the variables.
* 2.Object.Eqals Method compares address of the variables
* **************************************************************/ }
Author: Raghavendra
Click here for job guarantee courses in bangalore












