"Private Shared Function"

  • Thread starter Thread starter Edward
  • Start date Start date
E

Edward

I have trouble with some of the concepts of OOP, and am struggling
currently with Private Shared Functions.

I think I understand Private (not available outside the class).

I think I understand Shared (available without having to instantiate a
class).

So how could a Private Shared Function be called? Why give it this
particular scope?

Sorry if this is one of those Doh! questions.

Edward
 
Private Shared methods and variables are essentially private methods or
variables that can be accessed from within Public Shared members.

Since it is not possible to call Instance members (private, public, etc.)
from Shared members, you can use Private Shared members to create helper
functions for Shared members (to help with overloads for example).

And don't worry, I had the same question myself until I first found a use
for it in a project I was working on :o)

Hope this helps,

Danny van Kasteel
 

Ask a Question

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.

Ask a Question

Back
Top