R
rk_kitty
Unregistered / Unconfirmed
GUEST, unregistred user!
type
TBase = class
protected
procedure base_not_virtual;
procedure base_is_virtual;virtual
end;
...
procedure TBase.base_not_virtual;
begin
//do something;
end;
procedure TBase.base_is_virtual;
begin
//do something;
end;
type
TDrivered = Class(TBase)
protected
procedure base_not_virtual;
procedure base_is_virtual;override;
end;
...
procedure TDrivered.base_not_virtual;
begin
inherited;
//do something;
end;
procedure TDrivered.base_is_virtual;
begin
inherited;
//do something;
end;
發現它們運行的結果完全相同.請大俠用實例說明在什麼情況下出現不同.
TBase = class
protected
procedure base_not_virtual;
procedure base_is_virtual;virtual
end;
...
procedure TBase.base_not_virtual;
begin
//do something;
end;
procedure TBase.base_is_virtual;
begin
//do something;
end;
type
TDrivered = Class(TBase)
protected
procedure base_not_virtual;
procedure base_is_virtual;override;
end;
...
procedure TDrivered.base_not_virtual;
begin
inherited;
//do something;
end;
procedure TDrivered.base_is_virtual;
begin
inherited;
//do something;
end;
發現它們運行的結果完全相同.請大俠用實例說明在什麼情況下出現不同.