計劃方法上Button_Event錯誤在VB程序
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim obj As New clsBook
obj.show(5)
obj.show(5, "JAVA")
obj.show(5, "JAVA", "XYZ")
End Sub
錯誤超載 類書
Public Class clsBook
Public Function show(ByVal bn As Integer)
MsgBox(bn)
End Function
Public Function show(ByVal bn As Integer, ByVal bna As String)
MsgBox(bn, bna)
End Function
Public Function show(ByVal bn As Integer, ByVal bna As String, ByVal bp As String)
MsgBox(bn, bna, bp)
End Function
End Class
=
Conversion from string "JAVA" to type 'Integer' is not valid.
任何人都可以請解釋如何去解決這個?
閱讀MSGBOX :) – 2014-09-26 12:52:51
文檔這將是很難找到的命名不佳的更完整的例子比這個代碼... – David 2014-09-26 12:53:20
您應該嘗試通過代碼進行調試/步進查看。但非常多,字符串'JAVA'不是int – 2014-09-26 12:53:53