我有一個函數,當我打電話時,它讓我不用(),爲什麼?以同樣的方式調用函數和屬性?
Public Class Socio
Private _antiguedad As Integer
Public Function RetornarAntiguedad() As Integer
Return _antiguedad
End Function
End Class
Sub Main()
Dim test = New Socio()
test.RetornarAntiguedad <--- This works even though it doesnt have(), why?
Console.ReadKey()
End Sub
它看起來像一個屬性?它不會在函數和屬性之間產生混淆?