What is allowed in Visual Basic that's prohibited in C# (or vice versa)?

后端 未结 21 1832
渐次进展
渐次进展 2020-12-05 06:07

This is code-related as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in

21条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 06:40

    Indexed properties are allowed in VB.NET, but not in C#

        Private m_MyItems As New Collection(Of String)
        Public Property MyItems(ByVal index As Integer) As String
            Get
                Return m_MyItems.Item(index)
            End Get
            Set(ByVal value As String)
                m_MyItems.Item(index) = value
            End Set
        End Property
    

提交回复
热议问题