How to access private functions in a public class from another class in VB.NET

1 Answer

0 votes
Imports System

Public Class Example
    Public ReadOnly Property prop() As String
        Get
            Return pf()
        End Get
    End Property

    Private Function pf()
        Return "VB.NET Programming"
    End Function
End Class

Public Class Test
    Public Shared Sub Main()
        Dim o As Example = New Example()
        
        Console.WriteLine(o.prop())
    End Sub
End Class
  
  
  
' Run:
'
' VB.NET Programming

 



answered Mar 28, 2019 by avibootz

Related questions

...