[求助]关于 is 操作符
namespace Indexers{
struct PhoneNumber
{
public PhoneNumber(string text)
{
this.number = text;
}
public string Text
{
get { return this.number; }
}
public override int GetHashCode()
{
return this.number.GetHashCode();
}
public override bool Equals(object other)
{
return (other is PhoneNumber) && Equals((PhoneNumber)other);
}
public bool Equals(PhoneNumber other)
{
return this.number == other.number;
}
private string number;
}
}
如红色部份的代码,other是object类型, 为什么可以用other is PhoneNumber呢?