"Boni" <oilia@nospam > wrote in message
news:er******** ******@TK2MSFTN GP15.phx.gbl...
I would like to have an access from one class to the private
variables of other.
You can't. If you need to be access a variable outside of a given
class, it has to be exposed, probably via a property.
Looking at your code, I would tend towards adding a Friend
method called something like "Prime", which class *in the same
assembly* can use to pass in a value, as in
Class A
Private K as Integer = Integer.MinValu e
Friend Sub Prime( ByVal Value As Integer )
' Prevent Prime being called more than once
If K <> Integer.MinValu e Then
Throw New ApplicationExce ption()
End If
K = Value
End Sub
End Class
Class B
Private oA As New A
Sub New()
oA.Prime( 10 )
End Sub
End Class
HTH,
Phill W.