pigeonrandle wrote:
> Hi,
> Can anyone tell me why i cant create the following class as 'static':
>
> //Start
>
> using System;
>
> namespace WinAppSQL.windows
> {
> public static class WinAPI
> {
> public static int go() { return 1; }
> }
> }
>
> //End
>
> The compiler refuses! I'm using VS2003 framework 1.1.4322 SP1.
Because classes can't be marked static?
If you want a class to be non-creatable, give it a private default
constructor:
class ICantBeInstantiated
{
private ICantBeInstantiated()
{ }
}
It's up to you as the class implementer to not create any instances
within the class itself...
--
Larry Lard
(E-Mail Removed)
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version