protected and private

Y

yurps

what is the difference between class members which are marked with
these....?

I wonder because I have a namespace with a few different classes...
I want to use a method from another class...currently it only works
with public...but that means anybody can use this method and I don't
want that...

what's up here?
 
K

Karl Seguin

You probably want internal (or friend in vb.net)

internal/friend means that only classes in the same assembly (dll/project)
can call on the member.

protected means only classes which inherit or the class itself
private means only the class itself

yuo can have internal protected (both of them) which would mean any class
in the assembly OR any child class..

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
 

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

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top