By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,579 Members | 1,773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,579 IT Pros & Developers. It's quick & easy.

about inherits

P: n/a
Tom
Can I inherits private class in public class vb.net ?

if can't , how can I do that ? such that I want to hidden some class in
project
Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Are you looking for protected classes by any chance??

Rgds,
Anand
http://www.dotnetindia.com

"Tom" wrote:
Can I inherits private class in public class vb.net ?

if can't , how can I do that ? such that I want to hidden some class in
project

Nov 21 '05 #2

P: n/a
Tom,

Don't you make from your private class, if you inherit that in your public
class, directly from that a public class?

I hope this helps,

Cor
Nov 21 '05 #3

P: n/a
"Tom" <pc***@tomgroup.com> schrieb:
Can I inherits private class in public class vb.net ?

if can't , how can I do that ? such that I want to hidden some class in
project


You cannot. If a class is 'Public', its base class must be public too.
What you can do is putting the code in a 'Friend' class and use this class
in your public class.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

P: n/a
Herfried,

Before I write something wrong. What do yo mean with this?
What you can do is putting the code in a 'Friend' class and use this class
in your public class.


Cor
Nov 21 '05 #5

P: n/a
Cor,

"Cor Ligthert" <no************@planet.nl> schrieb:
Before I write something wrong. What do yo mean with this?
What you can do is putting the code in a 'Friend' class and use this
class in your public class.


\\\
Public Class Foo
Public Sub Bla()
Dim i As New ImplementationDetail()
i.Goo()
...
End Sub
End Class

Friend Class ImplementationDetail
Public Sub Goo()
...
End Sub
End Class
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #6

P: n/a
Herfried,
Before I write something wrong. What do yo mean with this?
What you can do is putting the code in a 'Friend' class and use this
class in your public class.

Than I have nothing to say. It was the word "Use", however I was not sure
what you meant with that. Now it is for the OP as well clear that it is not
a use as inheriting however instancing.

:-)

Cor
Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.