Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2005, 05:44 AM
Registered User
 
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yuanlairuci
Default 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
 
Old March 23rd, 2005, 12:03 PM
Friend of Wrox
 
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

okay,prefix and number are private for other classes(rhs is inside the EmployeeID class).

_____________
Mehdi.
software student.
 
Old March 23rd, 2005, 09:42 PM
Registered User
 
Join Date: Feb 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to yuanlairuci
Default

thank you !

yuanlairuci





Similar Threads
Thread Thread Starter Forum Replies Last Post
New Member Install TBH problem smhaig BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 3 February 10th, 2007 01:33 PM
private constructor in C# n.nsivakumar C# 1 August 16th, 2006 07:08 AM
A problem about the use of the private member yuanlairuci BOOK: Professional C#, 2nd and 3rd Editions 1 April 7th, 2005 02:24 AM
Using Private Sub cutovoi Excel VBA 0 February 5th, 2004 12:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.