代碼如下(vb.net)//Piece是我自定義的一個很簡單的類。//這代碼是在另外一個類里面Private m_Pieces As List(Of Piece)Public Property Pieces() As List(Of Piece)GetReturn m_PiecesEnd GetSet(ByVal value As List(Of Piece))m_Pieces = valueEnd SetEnd Property編譯錯誤:Public Property Pieces As System.Collections.Generic.List(Of Piece)”和“Public Property Pieces As System.Collections.Generic.List(Of Procedure)”的差異僅在于返回類型,因此它們無法重載對方。英文版錯誤:You have attempted to overload a method with another method that differs from the first only in its return type. In overloading, you must differentiate any two versions of a method by their argument lists; you cannot use anything other than argument lists to differentiate the methods.
添加回答
舉報
0/150
提交
取消