R
Raj
Both this.ToString() and base.ToString() returns the same in derived class. I
assumed base will point to base class and this will point to invoking
object's class.
Ex:
class iambaseclass
{
public int var1;
}
class iamchildclass:iambaseclass
{
public int var2;
Console.WriteLine(base.ToString());
Console.WriteLine(this.ToString());
}
When I type base. intellisense it displays var1
When I type this., intellisense displays both var1, and var2
Very much confused ... intellisense and the programs output is contradictory!
Pl. justify
Thank you
Regards
Raj
assumed base will point to base class and this will point to invoking
object's class.
Ex:
class iambaseclass
{
public int var1;
}
class iamchildclass:iambaseclass
{
public int var2;
Console.WriteLine(base.ToString());
Console.WriteLine(this.ToString());
}
When I type base. intellisense it displays var1
When I type this., intellisense displays both var1, and var2
Very much confused ... intellisense and the programs output is contradictory!
Pl. justify
Thank you
Regards
Raj