Re: Create Null Object



Ah, yes, I forgot about that, Jon.

Scott


"Jon Skeet [C# MVP]" <skeet@xxxxxxxxx> wrote in message
news:MPG.1da5a8b42c16299298c7fe@xxxxxxxxxxxxxxxxxxxxxxx
> Scott <sdcoonce@xxxxxxxxxxxxxxxxx> wrote:
>> As a reminder, as an addition to that, so that users of the class don't
>> just
>> call the constructor and circumvent your CreateRole() static method, make
>> the constructo private, as in:
>>
>> private Role() {}
>
> Note that you don't need to supply an extra private parameterless
> constructor if you have other constructors (which would probably also
> be private). The compiler only supplies a public parameterless
> constructor if no constructors are specified in the code.
>
> --
> Jon Skeet - <skeet@xxxxxxxxx>
> http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
> If replying to the group, please do not mail me too


.



Relevant Pages


Loading