Quote:
|
in Java even if u import a class in a package(namespace here) u have to still instantiate(create object of) that class to access its members
|
Not true.
If the members are *STATIC* members, you SHOULD NOT use an instantiated object to access them. *AT MOST* you would use the class name as a prefix.
In other words:
Code:
// This is simplified Java code:
class Foo
{
static void Zap( String s ) { ... }
}
...
// then you should *NEVER* do
Foo f = new Foo( );
f.Zap("xyz");
// yes, it works, but it is VERY VERY misleading to do so!
// you should instead use
Foo.Zap("xyz");
The *SAME THING* applies with VB.NET (and with C# and with any other .NET language!).
You can *EITHER* do
Code:
System.Console.WriteLine("a message")
invoking the
STATIC method
WriteLine *OR* you can do
Code:
Imports System.Console
WriteLine("a message")
You need to keep the distinction between static and dynamic methods and members straight.