Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > BOOK: Professional C#, 2nd and 3rd Editions
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional C#, 2nd and 3rd Editions
This is the forum to discuss the Wrox book Professional C#, 3rd Edition by Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen; ISBN: 9780764557590
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C#, 2nd and 3rd Editions section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 19th, 2005, 01:05 AM
Registered User
 
Join Date: Feb 2005
Location: beijing, beijing, China.
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 the 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)
      {
         EmployeeID 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
  #2 (permalink)  
Old April 7th, 2005, 02:24 AM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

3rd.Edition Page 100
Note that the field is also public¡ªwe don¡¯t normally need
to make readonly fields private, because by definition they cannot be modified externally (the same principle also applies to constants).

 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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 C# 2 March 23rd, 2005 09:42 PM
Using Private Sub cutovoi Excel VBA 0 February 5th, 2004 12:55 PM



All times are GMT -4. The time now is 08:44 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.