Re: A truly uninstantiable class?



On Fri, 14 Oct 2005 00:05:49 +0100, "Ross Bamford"
<rosco@xxxxxxxxxxxxxxxxxxxxxx> wrote or quoted :

>Otherwise, 'final' with the private constructor would be a better bet I
>think.

Constructors cannot be overridden even when you use the same name and
signature in a subclass. So in that sense all constructors are final
anyway..

All private methods are automatically final.

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
.



Relevant Pages

  • Re: Types of constructors
    ... A private constructor is a constructor that can only be used from within the ... You could have a class that has one or more private constructors and also ... one or more public constructors. ... Indeed -- Public, Private and Friend describe the scope of the constructor, ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Types of constructors
    ... > the other kinds of constructors besides: ... This is generally a sealed class with only a private constructor. ... only provides static methods. ...
    (microsoft.public.dotnet.general)
  • Re: Types of constructors
    ... -You typically define a private constructor when you do not want a class to ... has static methods. ... static constructors which get called before the ... HTH ...
    (microsoft.public.dotnet.faqs)
  • Types of constructors
    ... What is a private constructor, and why would a class have one? ... the other kinds of constructors besides: ...
    (microsoft.public.dotnet.faqs)
  • Types of constructors
    ... What is a private constructor, and why would a class have one? ... the other kinds of constructors besides: ...
    (microsoft.public.dotnet.languages.csharp)