這是第一種方式:策略創建
Public Class MyClass
Private _Property As String
Property Property() As String
Get
Return _Property
End Get
Set(ByVal Value As String)
_Property = Value
End Set
End Property
Public Function DoSomething() As String
Return _Property & Now()
End Function
End Class
我也能做到這樣:
Public Class MyClass
Public Property As String
Public Function DoSomething() As String
Return Property & Now()
End Function
End Class
哪種方式最好?
對不起,我輸入的很快。 – Maysam 2012-03-13 13:48:01
不用擔心。回答你的問題是重要的。 – 2012-03-13 13:49:17