我对 VB.net 很陌生,我无法编译这段代码,我不明白为什么。
MustInherit Class Poligono
Protected p_cant_Lados As Integer
Public Property cant_Lados() As Integer
Get
Return p_cant_Lados
End Get
Set(ByVal value As Integer)
p_cant_Lados = value
End Set
End Property
Public MustOverride Function obtenerPerimetro()
Public MustOverride Function cargarLados()
End Class
Public Class Triangulo
Inherits Poligono
Private lado1 As Integer
Private lado2 As Integer
Private lado3 As Integer
Public Function cargarLados() As Object
Return 1
End Function
Public Function obtenerPerimetro() As Object
Return 1
End Function
End Class
错误 2 'Triangulo' 不能从类 'Poligono' 继承,因为它扩展了程序集外部基类的访问权限。c:\users\win7\documents\visual studio 2013\Projects\WindowsApplication1\WindowsApplication1\Form1.vb 33 14 WindowsApplication1
谢谢!