F
Fucool
Unregistered / Unconfirmed
GUEST, unregistred user!
看了程序员杂志附带的李唯先生的AVI,试做了一下,有几个小问题?
VB。NEt
---------------------------------------------------------------
Public Class ClsDemoForDelphi8
Overridable Function getName() As String
Return "一些文字。"
End Function
Public Function GetDateTime() As Date
Return Date.Now
End Function
End Class
Public Class NewClsDemoForDelphi8
Inherits ClsDemoForDelphi8
Overrides Function getName() As String
Return "从上一个类中继下来"
End Function
End Class
以下出错
TdemoforVbClass = Class(ClsDemoForDelphi8)
public
function getName:string;override;
end;
--------------------------------------------------------
C#
---------------------------------------------------------------
public class Class1
{
public Class1()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public virtual string getName ()
{
return "这是用C#进行的测试。";
}
}
C#正常
TdemoforVbClass = Class(Class1)
public
function getName:string;override;
end;
-----------------------------------------------------------
问题是
Overridable Function getName() As String
Return "一些文字。"
End Function
public virtual string getName ()
{
return "这是用C#进行的测试。";
}
的区别????
VB。NEt
---------------------------------------------------------------
Public Class ClsDemoForDelphi8
Overridable Function getName() As String
Return "一些文字。"
End Function
Public Function GetDateTime() As Date
Return Date.Now
End Function
End Class
Public Class NewClsDemoForDelphi8
Inherits ClsDemoForDelphi8
Overrides Function getName() As String
Return "从上一个类中继下来"
End Function
End Class
以下出错
TdemoforVbClass = Class(ClsDemoForDelphi8)
public
function getName:string;override;
end;
--------------------------------------------------------
C#
---------------------------------------------------------------
public class Class1
{
public Class1()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public virtual string getName ()
{
return "这是用C#进行的测试。";
}
}
C#正常
TdemoforVbClass = Class(Class1)
public
function getName:string;override;
end;
-----------------------------------------------------------
问题是
Overridable Function getName() As String
Return "一些文字。"
End Function
public virtual string getName ()
{
return "这是用C#进行的测试。";
}
的区别????