That would only be with v2 which, I believe, has "static" classes. If you
are doing this in v1, then you can instantiate a class that has only static
members. If you have a constructor that has logic, that code will run.
You can also create a static constructor which runs the first time the class
is accessed.
"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.com> wrote in
message news:u7eo5$EEFHA.228@tk2msftngp13.phx.gbl...[color=blue]
> Mark,
>
> With a static class, you should get a compile error if you try and
> define any instance methods, including a constructor, so you shouldn't[/color]
even[color=blue]
> get that far.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> -
mvp@spam.guard.caspershouse.com
>
> "Mark Rae" <mark@mark-N-O-S-P-A-M-rae.co.uk> wrote in message
> news:ubRWU6EEFHA.3728@TK2MSFTNGP14.phx.gbl...[color=green]
> > "laimis" <simulai@iit.edu> wrote in message
> > news:erMhs2EEFHA.3728@TK2MSFTNGP14.phx.gbl...
> >[color=darkred]
> >> actually sealed classes can be instantiated and have a regular class
> >> behavior in c#. The "sealed" part means that the class cannot be[/color][/color][/color]
extended[color=blue][color=green][color=darkred]
> >> by other classes by inheritence. For instance if you have a class like
> >> this:[/color]
> >
> > Yes, sorry - I got myself confused with sealed and static.
> >
> > What I meant to ask was that if a sealed class provides only static
> > methods which are referenced without instiation of the class, does that
> > mean that even if that class has a constructor, the code inside the
> > constructor will never fire?
> >[/color]
>
>[/color]