Classes and Access Specifier's in VB.Net

  • Thread starter Thread starter ElanKathir .S.N
  • Start date Start date
E

ElanKathir .S.N

Hi all

In Vb.Net, I tried a sample like this:

Private Class
----------
---------
End Class

But FrameWork is not accecting this class, It showing some Error like
Private is not possible in the outside of the Public access specifier.

But Java subports the Private things in outside of the Public.

Why .Net is not?

Thanks & Regards

Elankathir,
B'lore,
India.
 
ElanKathir .S.N said:
In Vb.Net, I tried a sample like this:

Private Class
----------
---------
End Class

But FrameWork is not accecting this class, It showing some Error
like Private is not possible in the outside of the Public access
specifier.

Private in relation to what? Private means private within the enclosing
class. If there's no enclosing class, Private is invalid. If you want the
class to be visible only in the same assembly, use the Friend modifier
instead.


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
* ElanKathir .S.N said:
In Vb.Net, I tried a sample like this:

Private Class
----------
---------
End Class

But FrameWork is not accecting this class, It showing some Error like
Private is not possible in the outside of the Public access specifier.

Where exactly do you use this code? You will have to declare the class
inside another type if you want to mark it as 'Private'.
 
Back
Top