473,396 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

"Private Shared Function"

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
Nov 20 '05 #1
1 23066
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

"Edward" <te********@hotmail.com> wrote in message
news:25**************************@posting.google.c om...
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

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: santa19992000 | last post by:
Confusing th eword with "library", "shared library" and how to use these things in real C project, is there any small example I can take a look. Thanks.
6
by: Ross | last post by:
MyWebProject.MyWebForm1.someset.somedata is a datatable within a dataset. Displays quite nicely, too. Now I want to use the same data in MyWebProject.MyWebForm2. Being a old, er, experienced Java...
3
by: Henri | last post by:
Hi, Sorry for my bad English. Could you tell me if the context of a member declared as Shared is limited to the instance of the page the object that owns this member is declared in, or does it...
2
by: John Granade | last post by:
I'm looking for the best way to make a dataset available from multiple Windows forms. The dataset is created from an XML file. I have a main form (frmMain) that loads the dataset and reads the...
1
by: David Sanschagrin | last post by:
(I previously posted this problem on vb.general.discussion but I've been told that this question is more related to VB.NET than VB6 and so that I should post that here.) I'm trying to call a...
2
by: HmFireBall | last post by:
Hi, This is a question about a shared property in ASP.NET Imagine there's an assembly called my.dll that is in the /bin directory of several websites. This assembly contains a class with a...
3
by: Kenneth Kahl | last post by:
Hello, I would like to call a C++ programm out of Java with help of JNI. By the followed command I created a "shared library": g++ -shared -o libcalculate.so rechner.cpp When I create an...
3
by: jbeteta | last post by:
Hello, I have a problem declaring variables. I need to create an object oRpte as ReportClass on WebForm1.aspx and be able to use its value on WebForm2.aspx. For declaring the property oRpte()...
0
by: Joe Strout | last post by:
Hi Luis, A static variable IS encapsulation. Encapsulation happens at many levels: module, class, instance, and (in languages that support it) method. A static local variable is simply the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.