Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Can I define a "Abstract" class in VB.NET?

 

It means I do not need to create a object to refers to this class; I can direct use the methods/functions of the class without declared any object.

 

I use it before in "Java"

  • *Experts*
Posted

Static var As Integer

When the variables go out of scope, they retain their values (though

can't be accessed from outside of the procedure they're declared in).

 

The term Static comes from the fact that the variable keeps

a static location in memory, thus preserving the data.

Posted

You mean "Shared" and "Static" are the same, the only different is that 'Static' can't be access from outside the procedure? right?

 

Actually what is the purpose for Microsoft to do that? Why don't use the same? either 'Shared' or 'Static'?

  • *Experts*
Posted

No, Shared means that a sub inside a class can be accessed from

anywhere, without declaring an instance of the class. In VB6, a

public method in a module did what a shared method in a class

does in VB.NET; although modules still exist in .NET, you should

use Shared methods in classes.

Posted

In this case: I create a class 'Car' with 2 functions 'A' and 'B'. 'A' declare as "Shared", 'B' is normal public function.

 

If I want to access these functions (A and B), then do I need to create object for class 'Car'?

 

This is what I confuse now....

 

Sorry because disturb you again...

  • *Experts*
Posted

I believe he said the Language Reference. Check out the keyword "Shared", "Static" etc. and read as much as you can - there is a GREAT deal of info around the class and member modifiers (such as public, private, shared, etc.). It's well worth the effort to spend 8 hours or so writing small sample classes and seeing what each keyword does and doesn't do. A book on VB.NET would cover this as well with good samples.

 

-Nerseus

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...