VB.NET v2.0: Property Gets and Sets with Different Accessibility

Once again there is mention of a new cool feature in C#:

Properties can now have different accessibility for get {...} and set {...}.

Well, once again this is also available in VB.NET v2.0:

Private _myProperty As String

Public Property MyProperty() As String
    Get
        Return _myProperty
    End Get
    Protected Set(ByVal value As String)
        _myProperty = value
    End Set
End Property

As much as I prefer C# myself, I'm starting to wonder what's not in VB?

Published Tuesday, October 28, 2003 10:06 PM by PaulWilson

Comments

# re: VB.NET v2.0: Property Gets and Sets with Different Accessibility

Why should anything be in one language and not the other? Personally I would prefer if there was no functional difference between the languages.

Wednesday, October 29, 2003 4:24 AM by Duncan

# re: VB.NET v2.0: Property Gets and Sets with Different Accessibility

" I'm starting to wonder what's not in VB?"
A decent syntax. Example: '()'. No further questions, Your Honour :)

Wednesday, October 29, 2003 5:26 AM by Frans Bouma

# re: VB.NET v2.0: Property Gets and Sets with Different Accessibility

Well, so far it seems that in a lot of the demos, VB seems to be getting a lot more design time support in the RAD environment - I don't know if C# is getting these design features and no one is mentioning them, or what....

Wednesday, October 29, 2003 9:58 AM by Jerry Dennany

Leave a Comment

(required) 
(required) 
(optional)
(required)