O'Reilly Forums: Dinnerparty P.214 - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Dinnerparty P.214 question public private

#1 User is offline   Mike684 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 29-October 12

Posted 16 November 2012 - 04:33 AM

I have a question concerning the fields in the DinnerParty Class.

The given solution on page 214 works (of course), but setting all the fields private works well too.

private const int CostOfFoodPerPerson = 25;
private decimal CostOfBeveragesPerPerson;
private decimal CostOfDecorations = 0;
private int numberOfPeople;
private bool fancyDecorations;


My question is if this would not be preferable? (Since this disallows changes from Form1)

Thanks!

This post has been edited by Mike684: 16 November 2012 - 04:38 AM

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users