I believe you are refering to static classes/methods, etc. (Static classes in C# is a new 2.0 feature, from what I've seen in BETA
2)
I believe VB.NET already supports static classes, but they are called something different. (Modules, perhaps?)
Here's a 'static' example that works in any framework version (written in C#):
public namespace MyNamespace
{
public sealed class Math // sealed prevents other classes from inheriting "Math"
{
// private constructor prevents classes from creating an instance of "Math"
private Math()
{
}
public static int Add(int v1, int v2) // static keyword means that this method is 'shared' (VB keyword) amoung all
classes that it is visible to
{
return v1 + v2;
}
}
}
// example to use Math (notice, Math already exists in the framework, and is static, but does not have an Add method
public class Test
{
static void Main() // entry point to our application (notice, it is "static" which means an instance of "Test" is not
required)
{
// print '3':
Console.WriteLine(MyNamespace.Math.Add(1, 2));
// ^ didn't have to write new Math() to use the "Add" method
}
}