about inherits

  • Thread starter Thread starter Tom
  • Start date Start date
T

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
 
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
 
Tom said:
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.
 
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
 
Cor,

Cor Ligthert said:
Before I write something wrong. What do yo mean with this?

\\\
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
///
 
Herfried,
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
 

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