VB.Net program to demonstrate the ‘Friend’ keyword
'VB.net program to demonstrate the "Friend" keyword.
Class Sample
' The Fun() is public if we are in the same assembly.
Friend Sub Fun()
Console.WriteLine("Friend function Fun() called")
End Sub
End Class
Module Module1
Sub Main()
Dim obj As New Sample()
obj.Fun()
End Sub
End Module
Friend function Fun() called
Press any key to continue . . .
Table of Contents