static and protection

Regan Heath regan at netwin.co.nz
Wed Mar 1 18:20:19 PST 2006


On Wed, 01 Mar 2006 18:22:06 -0700, Hasan Aljudy <hasan.aljudy at gmail.com>  
wrote:
>>> Well, do people use your *ORGANS* when you work with them?
>>   No. However a better analogy is "I will let my neighbour come over  
>> and use  my basketball hoop, but not the general public."
>>  class Me {
>>   private BasketBallHoop hoop;
>> }
>>  class Neighbour {
>>   void playSomeBall(BasketBallHoop hoop) {}
>> }
>>  void main()
>> {
>>   Neighbour bob = new Neighbour();
>>   Me regan = new Me();
>>   bob.playSomeBall(regan.hoop);
>> }
>>  Regan
>
> Why would you *not* allow the general public to play with your hoop?

Because, I can only trust myself and my neighbour not to break it. :)

Regan



More information about the Digitalmars-d mailing list