A problem about the use of the private member
In the Chapter 5 of Professional C# 2nd Edition i find a problem about the example of MortimerPhonesEmployees.As follows:
class EmployeeID
{
private readonly char prefix;
private readonly int number;
..........
..........
public override bool Equals(object obj)
{
mployeeID rhs = obj as EmployeeID;
if(rhs == null)
return false;
if(prefix == rhs.prefix && number == rhs.number)
return true;
return false;
}
prefix and number are the private members of the object rhs,why it can be used like the bold?Thanks for the helper!
yuanlairuci
|