在delphi中有两个类TBase = class
public
procedure Append;
end;TDerive = class(TBase)
protected
procedure Append
end;我本意是想在继承类中把Append方法隐闭起来,不让别人使用,但发现,如果我使用如下语句
var
t : TDerive;
begin
t := TDerive.Create;
t.append
end;编译时并没有任何报错,原因何在?
public
procedure Append;
end;TDerive = class(TBase)
protected
procedure Append
end;我本意是想在继承类中把Append方法隐闭起来,不让别人使用,但发现,如果我使用如下语句
var
t : TDerive;
begin
t := TDerive.Create;
t.append
end;编译时并没有任何报错,原因何在?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货