0

I like c#'s static classes because they can't be instantiated or inherited. They act like a namespace that can't be imported into the code file which allows for more managed organization. It doesn't seem that VB.NET has anything truly like this.

Modules - They're static, but everything within them is available in the global application scope which just clutters everything.

MustInherit - Keeps the class from being instantiated, but can still be inherited and then instantiated.

NotInheritable - Can't be inherited, but can be instantiated.

I guess I can settle for MustInherit, but I'd really like to see the c# equivalent of a static class.

oscilatingcretin
  • 10,457
  • 39
  • 119
  • 206

2 Answers2

0

Shared is basically the same as Static.

static/Shared in VB.NET and C# visibility

Community
  • 1
  • 1
T McKeown
  • 12,971
  • 1
  • 25
  • 32
0

Yes and no. There's no static class per-say but you can use Shared which offers similar functionality on members. See here on MSDN.

Lloyd
  • 29,197
  • 4
  • 84
  • 98