an object must be instanciated to access it. If you do not instanciate it,
it's value will be nothing. Only objects with shared methods, data, or
properties will be accessable with out instanciation in a class like that.
The "New" keyword initializes an object with the value from the type you
tell that it has to be initialized with.
dim a as myOwnClass 'a is an address where in is no reference to an object.
dim a as New MyOwnClass' is initialised accoording the "Sub new" in that
class and/or only with default values/objects from that class.
I'd have to check, but I don't believe that it is guarenteed by the .NET
spec... That is a VB.NET guarentee. For example, in C# Class level
variables are intitialized to their defaults - but locally scoped
variables are not.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.